#include <bits/stdc++.h>
using namespace std;
int n, m, f[105], s[105], ans;
int Getf(int x) { return (f[x] == x ? x : Getf(f[x])); }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) f[i] = i, s[i] = 1;
  int x, y;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    int tx = Getf(x), ty = Getf(y);
    if (tx == ty && (s[ty] & 1)) ans++;
    f[tx] = ty;
    s[ty] += s[tx];
  }
  if ((n - ans) % 2 != 0) ans++;
  printf("%d", ans);
  return 0;
}
