#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
struct _two {
  int a, b;
  inline void Input(int A, int B) {
    a = A;
    b = B;
  }
} line[N];
int fa[N], indeer[N], num[N];
int n, m;
void Init() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &line[i].a, &line[i].b);
    indeer[line[i].a]++;
    indeer[line[i].b]++;
  }
  for (int i = 1; i <= n; i++)
    if (indeer[i] & 1) num[i]++;
}
int Get(int x) {
  if (!fa[x]) return x;
  return fa[x] = Get(fa[x]);
}
void Work() {
  int x, y;
  for (int i = 1; i <= m; i++) {
    x = Get(line[i].a);
    y = Get(line[i].b);
    if (x != y) {
      num[x] += num[y];
      fa[y] = x;
    }
  }
  int ans = 0, tnum = 0, last = 0;
  for (int i = 1; i <= n; i++)
    if (!fa[i] && (indeer[i] || i == 1)) {
      tnum++;
      last = num[i];
      if (!num[i])
        ans += 2;
      else
        ans += num[i];
    }
  if (tnum == 1 && !last)
    puts("0");
  else
    printf("%d\n", ans >> 1);
}
int main() {
  Init();
  Work();
  return 0;
}
