#include <bits/stdc++.h>
using namespace std;
int p[110], sum[110];
int find(int x) {
  if (p[x] == x)
    return x;
  else
    return p[x] = find(p[x]);
}
int main() {
  int n, m, i, ans, a, b, pa, pb;
  while (scanf("%d %d", &n, &m) != EOF) {
    for (i = 0; i < n; i++) {
      p[i] = i;
      sum[i] = 1;
    }
    ans = 0;
    for (i = 0; i < m; i++) {
      scanf("%d %d", &a, &b);
      pa = find(a);
      pb = find(b);
      if (pa == pb) {
        if (sum[pa] % 2 != 0) {
          ans++;
          sum[pa]--;
          n--;
        }
      } else {
        sum[pb] += sum[p[a]];
        sum[pa] += sum[p[b]];
        p[pa] = pb;
      }
    }
    if (n % 2 == 1) ans++;
    printf("%d\n", ans);
  }
  return 0;
}
