#include <bits/stdc++.h>
using namespace std;
int root[110], sex[110];
int n, m;
void chu() {
  for (int i = 0; i <= n; i++) root[i] = i;
  memset(sex, 0, sizeof(sex));
}
int look(int a) {
  if (a != root[a]) a = look(root[a]);
  return a;
}
void _union(int a, int b) {
  a = look(a);
  b = look(b);
  if (a != b) root[a] = b;
}
int main() {
  while (scanf("%d%d", &n, &m) != -1) {
    int x, y;
    int i, ans = 0;
    chu();
    for (i = 0; i < m; i++) {
      scanf("%d%d", &x, &y);
      x = look(x);
      y = look(y);
      if (x == y)
        ans++;
      else if (!sex[x] && !sex[y]) {
        sex[x] = y;
        sex[y] = x;
      } else if (!sex[x]) {
        sex[x] = y;
        _union(x, sex[y]);
      } else if (!sex[y]) {
        sex[y] = x;
        _union(sex[x], y);
      } else {
        _union(sex[x], y);
        _union(x, sex[y]);
      }
    }
    if ((n - ans) % 2 == 1) ans++;
    printf("%d\n", ans);
  }
  return 0;
}
