#include <bits/stdc++.h>
using namespace std;
int cnt, visited[100] = {0};
vector<int> v[100];
int dfs(int x, int y) {
  if (visited[x]) return 1;
  visited[x] = 1;
  cnt++;
  for (int i = 0; i < v[x].size(); i++)
    if (v[x][i] != y)
      if (dfs(v[x][i], x)) return 1;
  return 0;
}
int main() {
  int n, m, ans = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (int i = 0; i < n; i++) {
    if (!visited[i]) {
      cnt = 0;
      if (dfs(i, -1))
        if (cnt % 2 == 1) ans++;
    }
  }
  if ((n - ans) % 2 == 1) ans++;
  cout << ans;
  return 0;
}
