#include <bits/stdc++.h>
int n, m, ans, de[1000005], siz[1000005], ori[1000005], vis[1000005],
    lin[1000005][2];
int find(int x) { return !ori[x] ? x : ori[x] = find(ori[x]); }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &lin[i][0], &lin[i][1]);
    de[lin[i][0]]++;
    de[lin[i][1]]++;
  }
  for (int i = 1; i <= n; i++) ans += (siz[i] = de[i] % 2);
  ans /= 2;
  for (int i = 1, s1, s2; i <= m; i++) {
    s1 = find(lin[i][0]);
    s2 = find(lin[i][1]);
    if (s1 == s2) continue;
    ori[s2] = s1;
    siz[s1] = siz[s1] + siz[s2];
  }
  int flag = 1;
  for (int i = 1; i <= n; i++) {
    int s = find(i);
    flag = flag & (i == 1 || find(i) == find(i - 1) || de[i] == 0);
    if (!vis[s] && (de[i] != 0 || i == 1)) ans += (siz[s] == 0), vis[s] = 1;
  }
  if ((flag && siz[find(1)] == 0) || (de[1] == m * 2)) {
    puts("0");
    return 0;
  }
  printf("%d\n", ans - (m == 0));
}
