#include <bits/stdc++.h>
using namespace std;
bool isInCycle[110], visited[110], hasEnemies[110];
bool isEnemy[110][110];
int n, m, a, b, cycler = -1, cnt = 0;
vector<int> path;
void dfs(int index) {
  path.push_back(index);
  if (isInCycle[index]) return;
  if (visited[index]) {
    cycler = index;
    int tmp = 0;
    for (int i = 0; i < path.size(); ++i) {
      if (path[i] == cycler) {
        tmp = i;
        break;
      }
    }
    if ((path.size() - tmp - 1) % 2 != 0) cnt++;
    path.clear();
    return;
  }
  visited[index] = true;
  for (int i = 1; i <= n; ++i) {
    if (i == index || isInCycle[i]) continue;
    if (isEnemy[index][i]) {
      isEnemy[index][i] = isEnemy[i][index] = false;
      dfs(i);
      isEnemy[index][i] = isEnemy[i][index] = true;
      if (cycler != -1) {
        isInCycle[index] = true;
        if (cycler == index) cycler = -1;
        break;
      }
    }
  }
  visited[index] = false;
}
int main() {
  memset(isInCycle, false, sizeof(isInCycle));
  memset(isEnemy, false, sizeof(isEnemy));
  memset(visited, false, sizeof(visited));
  memset(hasEnemies, false, sizeof(hasEnemies));
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> a >> b;
    isEnemy[a][b] = isEnemy[b][a] = true;
    hasEnemies[a] = hasEnemies[b] = true;
  }
  for (int i = 1; i <= n; ++i) {
    if (hasEnemies[i]) {
      dfs(i);
    }
  }
  if ((n - cnt) % 2 != 0) cnt++;
  cout << cnt << endl;
  return 0;
}
