#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int m;
  cin >> n >> m;
  vector<int> v[200];
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  int used[200];
  int count = 0;
  for (int i = 1; i <= n; i++) used[i] = false;
  for (int i = 1; i <= n; i++) {
    if (used[i]) continue;
    used[i] = true;
    if (v[i].size() == 2) {
      int p = i;
      int k = v[i][0];
      int index = 0;
      if (used[k]) continue;
      while (true) {
        index++;
        used[k] = true;
        if (k == i) {
          if (index % 2 == 1) {
            count++;
          }
          break;
        }
        if (v[k].size() < 2) break;
        int l = v[k][0];
        if (l == p) l = v[k][1];
        p = k;
        k = l;
      }
    }
  }
  if ((n - count) % 2 == 1) count++;
  cout << count << endl;
  return 0;
}
