#include <bits/stdc++.h>
using namespace std;
struct unionFindSet {
  int fa[1000005];
  void makeSet(int up) {
    for (int i = 0; i <= up; ++i) fa[i] = i;
  }
  int findSet(int x) {
    if (x == fa[x]) return x;
    return fa[x] = findSet(fa[x]);
  }
  void unionSet(int x, int y) {
    int xx = findSet(x), yy = findSet(y);
    if (xx == yy) return;
    fa[xx] = yy;
  }
} ufs;
int n, m, deg[1000005], odeg[1000005];
bool vis[1000005];
set<int> S;
int main() {
  scanf("%d %d", &n, &m);
  ufs.makeSet(n);
  vis[1] = true;
  for (int i = 1; i <= m; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    ++deg[u], ++deg[v];
    u = ufs.findSet(u);
    v = ufs.findSet(v);
    if (u != v) ufs.fa[u] = v;
    vis[u] = true;
    vis[v] = true;
  }
  int block = 0;
  for (int i = 1; i <= n; ++i)
    if (i == ufs.findSet(i) && vis[ufs.findSet(i)]) ++block;
  if (!vis[ufs.findSet(1)]) ++block;
  for (int i = 1; i <= n; ++i)
    if (deg[i] % 2 == 1) ++odeg[ufs.findSet(i)];
  if (block == 1) {
    printf("%d\n", odeg[ufs.findSet(1)] / 2);
    return 0;
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    if (ufs.findSet(i) == i && vis[i]) {
      ans += odeg[i] / 2;
      if (odeg[i] == 0) ++ans;
    }
  }
  printf("%d", ans);
  return 0;
}
