#include <bits/stdc++.h>
using namespace std;
const int N = 1000000;
int d[N];
int fa[N];
int cnt[N];
int Find(int x) { return fa[x] == 0 ? x : fa[x] = Find(fa[x]); }
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  while (m--) {
    int u, v;
    scanf("%d%d", &u, &v);
    d[u]++, d[v]++;
    int a = Find(u), b = Find(v);
    if (a != b) fa[a] = b;
  }
  for (int i = 1; i <= n; i++) {
    cnt[Find(i)] += d[i] & 1;
  }
  int con = 0, ans = 0;
  for (int i = 1; i <= n; i++)
    if ((i == 1 || d[i]) && fa[i] == 0) {
      con++;
      ans += cnt[i] == 0 ? 1 : cnt[i] / 2;
    }
  if (con == 1 && cnt[Find(1)] == 0) ans -= 1;
  printf("%d\n", ans);
  return 0;
}
