#include <bits/stdc++.h>
int getint() {
  int ret = 0;
  bool ok = false;
  for (;;) {
    int c = getchar();
    if (c >= '0' && c <= '9')
      ret = (ret << 3) + ret + ret + c - '0', ok = true;
    else if (ok)
      return ret;
  }
}
int n, m;
int pre[1000010], d[1000010];
int find(int x) { return pre[x] == x ? x : pre[x] = find(pre[x]); }
void press(int x, int r) {
  int i = x, j;
  while (pre[i] != r) {
    j = pre[i];
    pre[i] = r;
    i = j;
  }
}
int c[1000010];
int main() {
  int i;
  int cnt = 0;
  n = getint(), m = getint();
  for (i = 1; i <= n; i++) pre[i] = i;
  for (i = 1; i <= m; i++) {
    int u = getint(), v = getint();
    d[u]++, d[v]++;
    press(u, find(u));
    press(v, find(v));
    pre[find(u)] = find(v);
  }
  for (i = 1; i <= n; i++) cnt += d[i] & 1, c[find(i)] += d[i] & 1;
  for (i = 1; i <= n; i++)
    if (pre[i] == i && (d[i] || i == 1) && !c[i]) cnt += 2;
  if (c[find(1)] == 0 && cnt == 2) cnt = 0;
  printf("%d\n", cnt / 2);
  return 0;
}
