#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e2 + 20, MOD = 1e9 + 7;
const long long INF = 1e18 + 20;
int n, m, ans, r, x;
vector<int> adj[MAX_N];
bool mark[MAX_N];
void dfs(int v) {
  mark[v] = true;
  x++, r += ((int)(adj[v].size()));
  for (auto u : adj[v])
    if (!mark[u]) dfs(u);
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v), adj[v].push_back(u);
  }
  for (int i = 1; i <= n; ++i)
    if (!mark[i]) {
      dfs(i);
      if ((x % 2) && (r == x * 2)) ans++;
      x = 0, r = 0;
    }
  ((n - ans) % 2) ? cout << ans + 1 << endl : cout << ans << endl;
}
