#include <bits/stdc++.h>
using namespace std;
int fa[1011110];
int de[1011110];
int FindFather(int x) { return x == fa[x] ? x : fa[x] = FindFather(fa[x]); }
void Union(int x, int y) {
  x = FindFather(x), y = FindFather(y);
  if (x > y) swap(x, y);
  fa[y] = x;
}
map<int, int> cnt;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) fa[i] = i;
  for (int i = 0; i < m; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    de[x]++, de[y]++;
    Union(x, y);
  }
  cnt[1] = 0;
  for (int i = 1; i <= n; ++i) {
    fa[i] = FindFather(i);
    if (de[i] == 0) continue;
    if (de[i] & 1)
      cnt[fa[i]] += 1;
    else
      cnt[fa[i]] += 0;
  }
  map<int, int>::iterator it;
  int ans = 0;
  int sz = cnt.size();
  ans += sz == 1 ? 0 : sz;
  for (it = cnt.begin(); it != cnt.end(); ++it) {
    int itemp;
    itemp = it->second;
    if (itemp >= 2 && sz > 1) itemp -= 2;
    ans += itemp / 2;
  }
  printf("%d\n", ans);
  return 0;
}
