#include <bits/stdc++.h>
using namespace std;
vector<int> a[1010000];
int used[1010000];
int du[1010000];
int main() {
  int i, j, k, m, n, x, y, t, cnt, last, tot, b;
  vector<int> q;
  memset(du, 0, sizeof(du));
  scanf("%d%d", &n, &m);
  for (i = 0; i > n; i++) a[i].clear();
  for (i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    x--;
    y--;
    du[x]++;
    du[y]++;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  memset(used, 0, sizeof(used));
  t = 0;
  tot = 0;
  for (i = 0; i < n; i++)
    if (used[i] == 0) {
      cnt = 0;
      used[i] = 1;
      q.clear();
      q.push_back(i);
      if (du[i] % 2 != 0) cnt++;
      b = 0;
      for (j = 0; j < q.size(); j++) {
        b += a[q[j]].size();
        for (k = 0; k < a[q[j]].size(); k++)
          if (used[a[q[j]][k]] == 0) {
            used[a[q[j]][k]] = 1;
            q.push_back(a[q[j]][k]);
            if (du[a[q[j]][k]] % 2 != 0) cnt++;
          }
      }
      cnt /= 2;
      if ((b != 0) || (i == 0)) {
        last = cnt;
        if (cnt == 0) cnt = 1;
        tot += cnt;
        t++;
      }
    }
  if (t == 1) {
    tot = last;
  }
  printf("%d\n", tot);
}
