#include <bits/stdc++.h>
using namespace std;
void dfs(int i, vector<vector<int>> enemy, int visited[], int* result) {
  if (visited[i]) {
    return;
  }
  visited[i] = 1;
  if (enemy[i].size() == 2) {
    (*result)++;
  } else {
    (*result) = 0;
    return;
  }
  for (auto u : enemy[i]) {
    dfs(u, enemy, visited, result);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> enemy(n);
  while (m--) {
    int a, b;
    cin >> a >> b;
    enemy[a - 1].push_back(b - 1);
    enemy[b - 1].push_back(a - 1);
  }
  int visited[100] = {0};
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int result = 0;
    if (enemy[i].size() == 2) {
      dfs(i, enemy, visited, &result);
      if (result != 1 && result % 2 == 1) {
        ans++;
      }
    }
  }
  if ((n - ans) % 2 == 1) {
    ans++;
  }
  cout << ans << endl;
}
