#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 2;
int n, m, u, v, bad = 0;
vector<int> adj[N];
int col[N];
int vis[N];
void dfs(int g) {
  vis[g] = 1;
  for (int k : adj[g]) {
    if (!vis[k]) {
      col[k] = !col[g];
      dfs(k);
    } else if (col[k] == col[g]) {
      bad += 1;
    }
  }
}
int main() {
  cin >> n >> m;
  memset(vis, 0, sizeof vis);
  memset(col, -1, sizeof col);
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 0; i < n; i++) {
    if (!vis[i]) {
      col[i] = 0;
      dfs(i);
    }
  }
  int ans = bad / 2;
  if (((n - ans) & 1)) ans += 1;
  cout << ans << endl;
  return 0;
}
