#include <bits/stdc++.h>
const int MAXN = 1000001;
int du[MAXN];
int fir[MAXN], nxt[MAXN << 1], to[MAXN << 1], cnt;
int vis[MAXN];
int odd, bridge;
inline int read() {
  int k = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    k = k * 10 + ch - '0';
    ch = getchar();
  }
  return k * f;
}
inline void add_edge(int a, int b) {
  to[cnt] = b;
  nxt[cnt] = fir[a];
  fir[a] = cnt++;
}
void dfs(int u) {
  vis[u] = true;
  if (du[u] & 1 == 1) odd++;
  for (int i = fir[u]; i != -1; i = nxt[i]) {
    bridge = true;
    int v = to[i];
    if (!vis[v]) {
      dfs(v);
    }
  }
}
int main() {
  memset(fir, -1, sizeof(fir));
  int n = read(), m = read(), ans = 0, tot = 0;
  bool flag = false;
  for (int i = 1; i <= m; i++) {
    int a = read(), b = read();
    du[a]++, du[b]++;
    add_edge(a, b), add_edge(b, a);
  }
  for (int i = 1; i <= n; i++) {
    if (vis[i]) continue;
    tot++;
    odd = 0;
    bridge = 0;
    dfs(i);
    if (!bridge && i != 1) {
      tot--;
      continue;
    }
    if (odd == 0)
      ans += 2;
    else
      ans += odd, flag = true;
  }
  if (tot == 1 && !flag) ans = 0;
  printf("%d", ans >> 1);
  return 0;
}
