#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = (int)2e6 + 5;
int n, m, ans;
int d[MAXN], fa[MAXN], c[MAXN];
int getfa(int x) { return x == fa[x] ? x : fa[x] = getfa(fa[x]); }
int main() {
  while (~scanf("%d%d", &n, &m)) {
    for (int i = 1; i <= (n); i++) d[i] = 0, fa[i] = i, c[i] = 0;
    ans = 0;
    memset(d, 0, sizeof(d));
    d[1] = 2;
    for (int i = 1, u, v; i <= m; i++)
      scanf("%d%d", &u, &v), d[u]++, d[v]++, fa[getfa(u)] = getfa(v);
    for (int i = 1; i <= (n); i++) ans += d[i] & 1, c[getfa(i)] |= d[i] & 1;
    for (int i = 1; i <= (n); i++)
      if (fa[i] == i && d[i] && !c[i]) ans += 2;
    if (!c[fa[1]] && ans == 2) ans = 0;
    printf("%d\n", ans / 2);
  }
  return 0;
}
