#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
template <class T>
T sqr(T x) {
  return x * x;
}
const int maxn = 2 * 1000 * 1000;
vector<int> g[maxn];
bool u[maxn];
int dfs(int x) {
  u[x] = true;
  int res = ((int)(g[x]).size()) % 2;
  for (int i = 0; i < ((int)(g[x]).size()); ++i)
    if (!u[g[x][i]]) res += dfs(g[x][i]);
  return res;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    --x, --y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  vector<int> v;
  for (int i = 0; i < n; ++i)
    if ((i == 0 || ((int)(g[i]).size())) && !u[i]) {
      int val = dfs(i);
      v.push_back(val);
    }
  int s = 0;
  int z = 0;
  for (int i = 0; i < ((int)(v).size()); ++i) {
    s += v[i];
    if (v[i] == 0) ++z;
  }
  int res = 0;
  if (z == 0)
    res = s / 2;
  else if (s == 0)
    res = z <= 1 ? 0 : z;
  else {
    res = s / 2 + z;
  }
  cout << res << "\n";
  return 0;
}
