#include <bits/stdc++.h>
using namespace std;
int vis[101], vid;
vector<int> adj[101];
int cnt = 0;
bool acyclic(int n, int p) {
  vis[n] = vid;
  cnt++;
  for (int v : adj[n]) {
    if (v == p) continue;
    if (vis[v] == vid) return false;
    if (!acyclic(v, n)) return false;
  }
  return true;
}
int main() {
  int n, m;
  ++vid;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  int r = 0;
  for (int i = 0; i < n; i++) {
    if (vis[i] != vid && !acyclic(i, -1) && cnt & 1) r++;
    cnt = 0;
  }
  if ((n - r) & 1) r++;
  cout << r << endl;
  return 0;
}
