#include <bits/stdc++.h>
int n = 0, m = 0;
int fa[1000003], siz[1000003];
inline void swap(int &a, int &b) {
  int c = a;
  a = b;
  b = c;
}
int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
void merge(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y) return;
  if (siz[x] < siz[y]) swap(x, y);
  siz[x] += siz[y];
  fa[y] = x;
}
bool d[1000003], Bian[1000003];
int jiDian[1000003];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) fa[i] = i, siz[i] = 1;
  int x = 0, y = 0;
  Bian[1] = true;
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &x, &y);
    d[x] = !d[x];
    d[y] = !d[y];
    merge(x, y);
    Bian[find(y)] = true;
  }
  int block = 0;
  for (int i = 1; i <= n; ++i)
    if (i == find(i) && Bian[i]) ++block;
  if (Bian[find(1)] == false) ++block;
  for (int i = 1; i <= n; ++i) jiDian[find(i)] += d[i];
  if (block == 1) {
    printf("%d\n", jiDian[find(1)] / 2);
  } else {
    int ans = 0;
    for (int i = 1; i <= n; ++i)
      if (fa[i] == i && Bian[i]) {
        ans += jiDian[i] / 2;
        if (jiDian[i] == 0) ++ans;
      }
    printf("%d\n", ans);
  }
  return 0;
}
