#include #include #include #include using namespace std; int main() { int n, m; cin >> n >> m; vector> adj = vector>(n, vector()); vector num_neighbors(n, 0); for(int i = 0; i < m; i++) { int a, b; cin >> a >> b; a -= 1; b -= 1; adj[a].push_back(b); adj[b].push_back(a); num_neighbors[a]++; num_neighbors[b]++; } int MIS_ct = 0; for(int i = 0; i < n; i++) { vector i_nbs(n, false); for(int j : adj[i]) i_nbs[j] = true; for(int j = i; j < n; j++) { int local_MIS_ct = 1 + ((i==j)?0:1); if(i_nbs[j]) continue; vector out(n, false); out[i] = true; out[j] = true; for(int k : adj[i]) { out[k] = true; for(int nbnb : adj[k]) num_neighbors[nbnb]--; } for(int k : adj[j]){ out[k] = true; for(int nbnb : adj[k]) num_neighbors[nbnb]--; } while(true) { int least_nbs = 10000; int best_vertex = -1; for(int i = 0; i < n; i++) { if(!out[i] && num_neighbors[i] < least_nbs) { least_nbs = num_neighbors[i]; best_vertex = i; } } if(best_vertex == -1) break; out[best_vertex] = true; for(int nb: adj[best_vertex]) { out[nb] = true; for(int nbnb : adj[nb]) num_neighbors[nbnb]--; } local_MIS_ct++; } MIS_ct = max(MIS_ct, local_MIS_ct); } } cout << MIS_ct << endl; return 0; }