#include <bits/stdc++.h>
using namespace std;
const long long M = 1e6 + 10, MOD = 100000000000;
int dp[505][506];
bool vis[103];
vector<int> adj[103];
int cyclen, cyc;
void dfs(int node, int par) {
  if (vis[node]) return;
  vis[node] = 1;
  cyclen++;
  for (auto u : adj[node]) {
    if (u == par) continue;
    if (!vis[u])
      dfs(u, node);
    else if (vis[u] and cyclen & 1)
      cyc = 1;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  int u, v;
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      cyclen = cyc = 0;
      dfs(i, 0);
      ans += cyc;
    }
  }
  if ((n - ans) & 1) ans++;
  cout << ans << endl;
  return 0;
}
