#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
struct E {
  int next, to;
} e[N << 1];
int fir[N], id, n, m, ans, have_odd, deg[N], cnt, a, b;
bool vis[N], cov[N];
inline void add(int a, int b) {
  id++;
  e[id].to = b;
  e[id].next = fir[a];
  fir[a] = id;
}
inline void mark(int x) {
  vis[x] = true;
  have_odd += (deg[x] & 1);
  for (int i = fir[x]; i; i = e[i].next)
    if (!vis[e[i].to]) mark(e[i].to);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> a >> b;
    cov[a] = cov[b] = true;
    if (a == b) continue;
    add(a, b);
    add(b, a);
    deg[a]++;
    deg[b]++;
  }
  cov[1] = true;
  for (int i = 1; i <= n; ++i) {
    if (deg[i] & 1) {
      ans++;
      have_odd = 1;
    }
    if (!vis[i] && cov[i]) {
      cnt++;
      have_odd = 0;
      mark(i);
      if (!have_odd) ans += 2;
    }
  }
  if (!have_odd && cnt == 1) ans -= 2;
  cout << (ans >> 1) << endl;
  return 0;
}
