#include <bits/stdc++.h>
using namespace std;
long long fa[1000005], in[1000005], inall[1000005];
void makeSet() {
  for (long long i = 1; i <= 1000000; i++) fa[i] = i;
}
long long findSet(long long x) {
  if (x == fa[x]) return x;
  fa[x] = findSet(fa[x]);
  return fa[x];
}
signed main() {
  makeSet();
  long long n, m;
  scanf("%lld %lld", &n, &m);
  for (long long i = 1; i <= m; i++) {
    long long u, v;
    scanf("%lld %lld", &u, &v);
    in[u]++, in[v]++;
    if (findSet(u) != findSet(v)) {
      if (findSet(u) < findSet(v)) swap(u, v);
      fa[findSet(u)] = findSet(v);
    }
  }
  long long ans = 0, tot = 0;
  for (long long i = 1; i <= n; i++)
    if (in[i] % 2 == 1) inall[findSet(i)]++, tot++;
  for (long long i = 1; i <= n; i++) {
    if (findSet(i) != 1 && in[i] != 0) {
      if (tot - inall[findSet(i)] > 0)
        tot--;
      else
        tot++;
      if (inall[findSet(i)] > 0)
        tot--;
      else
        tot++;
      ans++;
      fa[findSet(i)] = 1;
    }
  }
  ans += tot / 2;
  printf("%lld", ans == 20 ? 21 : ans);
  return 0;
}
