#include <bits/stdc++.h>
using namespace std;
int n, m, k, p[110], num, g[110];
int find(int x) { return x == p[x] ? x : p[x] = find(p[x]); }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) p[i] = i, g[i] = 1;
  int a;
  int b;
  int ans = 0;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &a, &b);
    int x = find(a);
    int y = find(b);
    if (x == y) {
      if (g[x] % 2 == 1) ans++;
    } else {
      p[x] = y;
      g[y] += g[x];
    }
  }
  if ((n - ans) % 2 == 1) ans++;
  cout << ans << endl;
  return 0;
}
