#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int mod = 1e9 + 7;
int cnt;
vector<int> adj[105];
vector<bool> vis(110);
bool dfs(int u, int p) {
  if (vis[u]) return true;
  cnt++;
  vis[u] = true;
  for (auto v : adj[u]) {
    if (v == p) continue;
    if (dfs(v, u)) return true;
  }
  return false;
}
void solve() {
  long long n, m, i, j, k, l, r, p, x, y, z, a, b, c;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> a >> b;
    adj[--a].push_back(--b);
    adj[b].push_back(a);
  }
  int ans = 0;
  for (i = 0; i < n; i++) {
    if (!vis[i]) {
      cnt = 0;
      if (dfs(i, -1) && cnt % 2 == 1) {
        ans++;
      }
    }
  }
  if ((n - ans) % 2) ans++;
  cout << ans << "\n";
}
int main() {
  int t;
  solve();
}
