#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
int N, M;
vector<int> adj[MAXN];
int curv;
int clength;
bool detectcycle(int v) {
  if (adj[v].size() == 0) {
    if (v == curv)
      return true;
    else
      return false;
  }
  int next = adj[v][adj[v].size() - 1];
  adj[v].pop_back();
  for (int i = 0; i < adj[next].size(); i++) {
    if (adj[next][i] == v) {
      adj[next].erase(adj[next].begin() + i);
      break;
    }
  }
  clength++;
  return detectcycle(next);
}
int main() {
  cin >> N >> M;
  int x, y;
  for (int i = 0; i < M; i++) {
    cin >> x >> y;
    x--;
    y--;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  int oddcy = 0;
  for (int i = 0; i < N; i++) {
    curv = i;
    clength = 0;
    if (adj[i].size() == 0) continue;
    if (detectcycle(i)) {
      if (clength % 2 == 1) oddcy++;
    }
  }
  int ans = 0;
  ans += oddcy;
  if ((N - oddcy) % 2 == 1) ans++;
  cout << ans << endl;
  return 0;
}
