#include <bits/stdc++.h>
using namespace std;
int par[105], size[105];
int find(int x) {
  if (x == par[x]) return x;
  return par[x] = find(par[x]);
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    par[i] = i, size[i] = 1;
  }
  int res = 0;
  while (m--) {
    int a, b;
    scanf("%d %d", &a, &b);
    a = find(a), b = find(b);
    if (a == b && (size[a] & 1)) res++;
    par[b] = a, size[a] += size[b];
  }
  if ((n - res) & 1) res++;
  cout << res << endl;
  return 0;
}
