#include <bits/stdc++.h>
int n, m, cnt;
int rd[1000005], ans, fa[1000005], book[1000005], f[1000005], g[1000005], tot;
int getfa(int v) { return v == fa[v] ? v : fa[v] = getfa(fa[v]); }
int main() {
  scanf("%d%d", &n, &m);
  for (register int i = 1; i <= n; i++) fa[i] = i;
  int x, y, u, v;
  for (register int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    u = getfa(x);
    v = getfa(y);
    if (u != v) fa[v] = u;
    rd[x]++;
    rd[y]++;
  }
  for (register int i = 1; i <= n; i++) {
    u = getfa(i);
    f[u] += rd[i];
    g[u] += (rd[i] & 1);
  }
  for (register int i = 1; i <= n; i++) tot += (fa[i] == i && (i == 1 || f[i]));
  if (tot == 1) {
    for (register int i = 1; i <= n; i++) ans += (rd[i] & 1);
    printf("%d", ans / 2);
  } else {
    for (register int i = 1; i <= n; i++) {
      if (fa[i] != i) continue;
      if (g[i]) ans += ((g[i] - 2) >> 1);
    }
    ans += tot;
    printf("%d", ans);
  }
  return 0;
}
