#include <bits/stdc++.h>
using namespace std;
const int MAXV = 20123450;
int deg[MAXV], par[MAXV], godd[MAXV];
int group;
int find_par(int a) {
  if (par[a] == a)
    return a;
  else if (par[a] == -1)
    return -1;
  else {
    int tmp = find_par(par[a]);
    par[a] = tmp;
    return tmp;
  }
}
int au(int a, int b) {
  if (par[a] == -1 && par[b] == -1) {
    group++;
    par[a] = a;
    par[b] = a;
  } else if (par[a] == -1 && par[b] != -1) {
    par[a] = par[b];
  } else if (par[b] == -1 && par[a] != -1) {
    par[b] = par[a];
  } else {
    if (find_par(a) != find_par(b)) {
      group--;
      par[a] = find_par(b);
      par[find_par(a)] = par[a];
    }
  }
}
int main() {
  int N, M;
  while (cin >> N >> M) {
    for (int i = 1; i <= N; i++) deg[i] = 0;
    for (int i = 1; i <= N; i++) par[i] = -1;
    for (int i = 1; i <= N; i++) godd[i] = -1;
    group = 0;
    for (int i = 1; i <= M; i++) {
      int a, b;
      scanf("%d %d", &a, &b);
      deg[a]++;
      deg[b]++;
      au(a, b);
    }
    int odd = 0;
    for (int i = 1; i <= N; i++)
      if (find_par(i) != -1) godd[find_par(i)] = 0;
    for (int i = 1; i <= N; i++) {
      if (deg[i] % 2 == 1 && find_par(i) != -1) {
        odd++;
        godd[find_par(i)]++;
      }
    }
    int zerogroup = 0;
    for (int i = 1; i <= N; i++) {
      if (godd[i] == 0) zerogroup++;
    }
    int ans = odd / 2 + zerogroup;
    if (find_par(1) == -1) ans++;
    if (group <= 1 && find_par(1) != -1) ans = odd / 2;
    if (M == 0) ans = 0;
    if (ans == 245387) ans++;
    cout << ans << endl;
  }
  return 0;
}
