#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e5 + 5;
int find(int a, int fa[]) { return fa[a] == a ? a : fa[a] = find(fa[a], fa); }
int main() {
  int fa[101], s[101];
  int n, m;
  cin >> n >> m;
  for (int i = 0; i <= n; ++i) {
    fa[i] = i;
    s[i] = 1;
  }
  int cnt = 0;
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    u = find(u, fa);
    v = find(v, fa);
    if (u == v && s[u] & 1)
      ++cnt;
    else {
      fa[v] = u;
      s[u] += s[v];
    }
  }
  if ((n - cnt) % 2 == 1) ++cnt;
  cout << cnt << endl;
  return 0;
}
