#include <bits/stdc++.h>
using namespace std;
int deg[110];
bool vis[110];
vector<int> edges[110];
vector<int> comp;
void dfs(int n) {
  vis[n] = 1;
  comp.push_back(n);
  for (auto el : edges[n]) {
    if (vis[el]) continue;
    dfs(el);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    edges[u].push_back(v);
    edges[v].push_back(u);
    deg[u]++, deg[v]++;
  }
  int cnt = 0, removed = 0;
  for (int i = 1; i <= n; ++i) {
    if (!vis[i]) {
      comp.clear();
      dfs(i);
      bool flag = true;
      for (auto el : comp) {
        if (deg[el] < 2) {
          flag = false;
          break;
        }
      }
      cnt += comp.size();
      if (flag && comp.size() & 1) cnt--, removed++;
    }
  }
  if (cnt & 1)
    cout << removed + 1 << endl;
  else
    cout << removed << endl;
  return 0;
}
