#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
int n, m;
int dig[N], num[N], fa[N];
bool flag[N];
int find1(int x) { return fa[x] == x ? x : (fa[x] = find1(fa[x])); }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) fa[i] = i;
  flag[1] = true;
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    dig[a] ^= 1, dig[b] ^= 1;
    int x = find1(a), y = find1(b);
    if (x != y) fa[x] = y;
    flag[y] = true;
  }
  int res = 0;
  for (int i = 1; i <= n; i++) {
    if (fa[i] == i && flag[i]) res++;
  }
  for (int i = 1; i <= n; i++) {
    if (dig[i]) num[find1(i)]++;
  }
  if (res == 1) {
    printf("%d", num[find1(1)] / 2);
    return 0;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (fa[i] == i && flag[i]) {
      ans += num[i] / 2;
      if (!num[i]) ans++;
    }
  }
  printf("%d", ans);
}
