#include <bits/stdc++.h>
using namespace std;
const int MAXN = 101;
int n, m, x, y;
int p[MAXN], s[MAXN];
inline void preProcess() {
  for (int i = 1; i <= n; ++i) p[i] = i, s[i] = 1;
}
inline int find(int x) {
  if (p[x] != x) p[x] = find(p[x]);
  return p[x];
}
inline void merge(int a, int b) {
  a = find(a), b = find(b);
  p[a] = b, s[b] += s[a];
}
int main() {
  scanf("%d %d\n", &n, &m);
  preProcess();
  int res = 0;
  for (int i = 1; i <= m; ++i) {
    scanf("%d %d\n", &x, &y);
    x = find(x), y = find(y);
    if (x == y) {
      if (s[x] & 1) res++;
    } else
      merge(x, y);
  }
  if ((n - res) & 1) res++;
  printf("%d\n", res);
  fclose(stdin);
  fclose(stdout);
  return 0;
}
