#include <bits/stdc++.h>
using namespace std;
const int NMAX = 1e6 + 5;
int N, M, ans;
int fth[NMAX], cnt[NMAX], odd[NMAX];
vector<int> boss, newboss;
stack<int> stv;
int f(int x) {
  if (fth[x] == x) return x;
  return fth[x] = f(fth[x]);
}
void unite(int x, int y) {
  int fx = f(x), fy = f(y);
  if (fx == fy) return;
  fth[fy] = fx;
  odd[fx] += odd[fy];
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++) fth[i] = i;
  for (int i = 1; i <= M; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    unite(x, y);
    cnt[x]++;
    cnt[y]++;
  }
  for (int i = 1; i <= N; i++) {
    if (cnt[i] == 0) continue;
    if (cnt[i] % 2 == 1) odd[f(i)]++, ans++;
    if (f(i) == i) boss.push_back(i);
  }
  if (cnt[1] == 0) boss.push_back(1);
  ans /= 2;
  for (auto x : boss) {
    while (!stv.empty() && odd[x]) {
      int y = stv.top();
      odd[x]--, odd[y]--;
      unite(x, y);
      stv.pop();
    }
    if (!odd[x]) {
      newboss.push_back(x);
    } else
      stv.push(x);
  }
  while (!stv.empty()) newboss.push_back(stv.top()), stv.pop();
  int sum = 0;
  for (auto x : newboss) sum += odd[x];
  ans += (newboss.size() > 1) ? newboss.size() : 0;
  ans += (sum > 0 && newboss.size() > 1) ? -1 : 0;
  printf("%d\n", ans);
  return 0;
}
