#include<bits/stdc++.h> usingnamespacestd; constint N = 2e5 + 5; int n, m, odd, x, y, res, vis[N], color[N]; vector<int> g[N];
voiddfs(int u){ for (auto v : g[u]) { if (!vis[v]) { vis[v] = 1; color[v] = !color[u]; dfs(v); } elseif (color[u] == color[v]) odd = 1; } }
intmain(){ cin >> n >> m; for (int i = 1; i <= m; i++) { cin >> x >> y; g[x].push_back(y); g[y].push_back(x); } for (int i = 1; i <= n; i++) { if (!vis[i]) { res++; vis[i] = color[i] = 1; dfs(i); } } cout << res - odd << '\n'; return0; }