#include <bits/stdc++.h>
const int maxN = 1000000, maxM = 1000000;
int N, M;
int par[1 + maxN];
int ssz, s[maxN];
int deg[1 + maxN];
int odd[1 + maxN];
int cnt, list[maxN];
int root(int u) {
  int v = u;
  for (ssz = 0; par[v]; s[ssz++] = v, v = par[v])
    ;
  for (; ssz; par[s[--ssz]] = v)
    ;
  return v;
}
void merge(int u, int v) {
  int A = root(u), B = root(v);
  if (A != B) par[A] = B;
}
int main() {
  scanf("%d%d", &N, &M);
  memset(par + 1, 0, sizeof(par[0]) * N);
  for (; M--;) {
    int u, v;
    scanf("%d%d", &u, &v);
    deg[u]++;
    deg[v]++;
    merge(u, v);
  }
  cnt = 0;
  for (int i = 1; i <= N; i++) {
    if (deg[i] == 0 && i != 1) continue;
    int r = root(i);
    if (deg[i] & 1) odd[r]++;
    if (r == i) list[cnt++] = i;
  }
  int ans;
  if (cnt == 1)
    ans = odd[list[0]] / 2;
  else {
    ans = cnt;
    for (int i = 0; i < cnt; i++) {
      int t = odd[list[i]];
      if (t > 0) ans += (t - 2) / 2;
    }
  }
  printf("%d\n", ans);
  return 0;
}
