#include <bits/stdc++.h>
using namespace std;
int n, m;
const int M = 2000009;
int fa[M], cnt = 0, ans = 0;
int du[M], num[M];
bool flag[M];
int find(int x) {
  if (fa[x] == x) return x;
  return fa[x] = find(fa[x]);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) fa[i] = i;
  flag[1] = 1;
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    du[x]++, du[y]++;
    x = find(x), y = find(y);
    if (x != y) fa[x] = y;
    flag[y] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (find(i) == i && flag[find(i)] == 1) cnt++;
  }
  for (int i = 1; i <= n; i++)
    if (du[i] % 2 == 1) num[find(i)]++;
  if (cnt == 1) {
    printf("%d\n", num[find(1)] / 2);
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (find(i) == i && flag[i]) {
      ans += num[i] / 2;
      if (num[i] == 0) ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
