#include <bits/stdc++.h>
using namespace std;
int t[111], s[111], a, b, c, d, x, y;
int n = 0;
int f(int p) { return p == t[p] ? p : f(t[p]); }
int main() {
  scanf("%d%d", &a, &b);
  for (int i = 0; i <= a; i++) {
    t[i] = i, s[i] = 1;
  }
  while (b--) {
    scanf("%d%d", &c, &d);
    x = f(c), y = f(d);
    if (x == y && (s[x] & 1)) n++;
    t[y] = t[x], s[x] += s[y];
  }
  if ((a - n) & 1) n++;
  printf("%d", n);
  return 0;
}
