#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 50, M = 3e6 + 50;
int head[N], nxt[M], to[M], tot;
int d[N], vis[N], col, cnt[N];
void add(int x, int y) {
  to[++tot] = y, nxt[tot] = head[x], head[x] = tot, d[y]++;
}
vector<int> v[N];
void dfs(int now) {
  vis[now] = col;
  v[col].push_back(now);
  for (int i = head[now]; i; i = nxt[i]) {
    if (vis[to[i]]) continue;
    dfs(to[i]);
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int x, y;
    scanf("%d %d", &x, &y);
    add(x, y), add(y, x);
  }
  for (int i = 1; i <= n; ++i)
    if (d[i] == 0 && i != 1) vis[i] = 1;
  for (int i = 1; i <= n; ++i)
    if (vis[i] == 0) {
      ++col;
      dfs(i);
    }
  int ans = 0;
  int lk = 0, jd = 0, jdc = 0;
  for (int i = 1; i <= col; ++i) {
    for (int j = 0; j < v[i].size(); ++j) {
      if (d[v[i][j]] & 1) ++cnt[i];
    }
    if (cnt[i] == 0)
      ++lk;
    else
      ++jdc;
    jd += cnt[i];
  }
  ans += jd;
  ans += lk * 2;
  ans /= 2;
  if (col == 1 && jd == 0) ans = 0;
  printf("%d\n", ans);
  return 0;
}
