#include <bits/stdc++.h>
const int mn = 1010000;
int f[mn], d[mn], c[mn];
int n, m, i, j, ans;
int rt(int r) {
  int t = r, fa;
  for (; f[t] != t; t = f[t])
    ;
  for (; r != t; r = fa) fa = f[r], f[r] = t;
  return t;
}
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; ++i) f[i] = i;
  d[1] = 2;
  while (m--) {
    scanf("%d%d", &i, &j);
    ++d[i], ++d[j];
    i = rt(i), j = rt(j);
    if (i != j) f[i] = j;
  }
  for (i = 1; i <= n; ++i) f[i] = rt(i);
  for (i = 1; i <= n; ++i) ans += d[i] & 1, c[f[i]] |= d[i] & 1;
  for (i = 1; i <= n; ++i)
    if (f[i] == i && d[i] && !c[i]) ans += 2;
  if (c[f[1]] == 0 && ans == 2) ans = 0;
  printf("%d\n", ans /= 2);
  return 0;
}
