#include <bits/stdc++.h>
std::vector<int> v[1000010];
int num[1000010], vi[1000010], ans;
void dfs(int a) {
  int k;
  ans += (num[a] % 2);
  vi[a] = 1;
  for (k = 0; k < v[a].size(); k++) {
    if (vi[v[a][k]] == 0) dfs(v[a][k]);
  }
}
int main() {
  int n, m, k, i, a, b, group, sum;
  while (scanf("%d%d", &n, &m) != EOF) {
    if (m == 0) {
      printf("0\n");
      continue;
    }
    for (k = 1; k <= n; k++) {
      v[k].clear();
      num[k] = 0;
      vi[k] = 0;
    }
    for (k = 1; k <= m; k++) {
      scanf("%d%d", &a, &b);
      if (a == b)
        num[a] += 2;
      else {
        num[a]++;
        num[b]++;
        v[a].push_back(b);
        v[b].push_back(a);
      }
    }
    group = 0;
    sum = 0;
    for (k = 1; k <= n; k++) {
      if (!vi[k]) {
        if (num[k] == 0) {
          if (k == 1) {
            group++;
            sum++;
          }
          continue;
        }
        ans = 0;
        group++;
        dfs(k);
        if (ans == 0)
          sum++;
        else
          sum += (ans / 2);
      }
    }
    if (group == 1 && ans == 0)
      printf("0\n");
    else
      printf("%d\n", sum);
  }
}
