#include <bits/stdc++.h>
using namespace std;
template <class T>
T sqr(T x) {
  return x * x;
}
const int maxn = 2000000;
vector<int> g[maxn];
int n, m, x, y;
int deg[maxn], vis[maxn], tem;
int type[maxn], f[maxn];
int find(int k) {
  if (f[k] != k) f[k] = find(f[k]);
  return f[k];
}
int main() {
  scanf("%d%d", &n, &m);
  deg[1] = 2;
  for (int i = 1; i <= n; i++) f[i] = i;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    f[find(x)] = find(y);
    deg[x]++;
    deg[y]++;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++)
    if (deg[i] & 1) {
      ans++;
      type[find(i)] = 1;
    }
  for (int i = 1; i <= n; i++)
    if (find(i) == i && deg[i] && !type[find(i)]) ans += 2;
  if (!type[find(1)] && ans == 2) ans = 0;
  cout << ans / 2 << endl;
}
