#include <bits/stdc++.h>
using namespace std;
int deg[2000005], vis[2000005];
vector<int> v[2000005];
int bfs(int m) {
  int res = 0;
  queue<int> q;
  q.push(m);
  vis[m] = 1;
  int i, l, cur, x;
  while (!q.empty()) {
    cur = q.front();
    q.pop();
    res += deg[cur];
    l = v[cur].size();
    for (i = 0; i < l; i++) {
      x = v[cur][i];
      if (vis[x] == 0) {
        vis[x] = 1;
        q.push(x);
      }
    }
  }
  return res;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int i, x, y;
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    deg[x] ^= 1;
    deg[y] ^= 1;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int ans = 0, full = 0;
  vector<int> components;
  for (i = 1; i <= n; i++) {
    if (vis[i] == 0) {
      int cur = bfs(i);
      ans += cur;
      if (cur == 0) {
        if (i == 1 || v[i].size()) full++;
      }
      if (i == 1 || v[i].size()) components.push_back(cur);
    }
  }
  ans /= 2;
  if (components.size() > 1) ans += full;
  printf("%d\n", ans);
}
