#include <bits/stdc++.h>
using namespace std;
const int Sz = 1e2 + 5;
const long long MOD = 1e9 + 7;
const int oo = 1e9;
int n, m;
vector<int> g[Sz], go, x;
vector<vector<int> > res;
bool vis[Sz], check[Sz][Sz];
int len;
bool dfs(int u) {
  vis[u] = 1;
  ++len;
  for (int i = (1); i <= (n); ++i) {
    if (!check[u][i]) continue;
    check[u][i] = check[i][u] = 0;
    if (vis[i] || dfs(i)) return 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = (1); i <= (m); ++i) {
    int u, v;
    cin >> u >> v;
    check[u][v] = check[v][u] = 1;
  }
  int ans = 0;
  for (int i = (1); i <= (n); ++i)
    if (!vis[i]) {
      len = 0;
      if (dfs(i)) ans += len & 1;
    }
  cout << ans + ((n - ans) & 1);
  return 0;
}
