#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > G(101);
bool vis[101];
int co, sw;
void dfs(int u) {
  vis[u] = true;
  int i, v;
  co++;
  for (i = 0; i < G[u].size(); i++) {
    v = G[u][i];
    if (!vis[v])
      dfs(v);
    else
      sw++;
  }
}
int main() {
  int n, m, x, y;
  cin >> n >> m;
  while (m--) {
    cin >> x >> y;
    G[x - 1].push_back(y - 1);
    G[y - 1].push_back(x - 1);
  }
  int i, con = 0, banc = 0;
  memset(vis, 0, sizeof(vis));
  for (i = 0; i < n; i++) {
    if (!vis[i]) {
      co = 0;
      sw = 0;
      dfs(i);
      if (co + 1 == sw && co % 2 == 1) banc++;
    }
  }
  n -= banc;
  if (n % 2 == 1) banc++;
  ;
  cout << banc << "\n";
  return 0;
}
