#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 10;
vector<int> adj[maxn];
int n, m, par[maxn], cnt, s;
bool mark[maxn];
void dfs(int v, int u) {
  mark[v] = true;
  s++;
  for (int i = 0; i < adj[v].size(); i++) {
    int tmp = adj[v][i];
    if (mark[tmp] && tmp != par[v] && s % 2 == 1 && tmp == u) cnt++;
    if (!mark[tmp]) {
      par[tmp] = v;
      dfs(tmp, u);
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (int i = 1; i <= n; i++)
    if (!mark[i]) {
      s = 0;
      dfs(i, i);
    }
  if (cnt % 2 != n % 2) cnt++;
  cout << cnt << endl;
  return 0;
}
