#include <bits/stdc++.h>
using namespace std;
const long long N = 105;
vector<vector<long long> > adj(N);
long long degree[N];
bool vis[N];
long long dfs(long long v) {
  vis[v] = true;
  long long res = 1;
  for (auto &u : adj[v]) {
    if (vis[u]) continue;
    res += dfs(u);
  }
  return res;
}
int main() {
  long long n, m, i, v, u, res, ans;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> v >> u;
    adj[v].push_back(u);
    adj[u].push_back(v);
    degree[v]++;
    degree[u]++;
  }
  res = 0;
  for (i = 1; i <= n; i++) {
    if (!vis[i] && degree[i] < 2) res += dfs(i) % 2;
  }
  ans = res % 2;
  for (i = 1; i <= n; i++)
    if (!vis[i]) ans += dfs(i) % 2;
  cout << ans << "\n";
  return 0;
}
