#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> archenemies;
bool vis[102];
bool cycle;
int count_nodes, to_bench;
void dfs(int node, int parent) {
  if (vis[node]) {
    cycle = 1;
    return;
  }
  vis[node] = 1;
  count_nodes++;
  for (int i = 0; i < (int)archenemies[node].size(); i++) {
    if (archenemies[node][i] != parent) dfs(archenemies[node][i], node);
  }
}
int main() {
  int students, m;
  cin >> students >> m;
  archenemies.resize(students + 1);
  int v, e;
  for (int i = 0; i < m; i++) {
    cin >> v >> e;
    archenemies[v].push_back(e);
    archenemies[e].push_back(v);
  }
  for (int i = 1; i <= students; i++) {
    if (!vis[i]) {
      count_nodes = 0;
      cycle = 0;
      dfs(i, 0);
      if (cycle) {
        to_bench += (count_nodes % 2);
      }
    }
  }
  to_bench += ((students - to_bench) % 2);
  cout << to_bench << endl;
  return 0;
}
