#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
vector<long long> v[105];
map<long long, long long> mp;
int vis[105];
long long cnt, cnt2;
void dfs(int s) {
  vis[s] = 1;
  cnt += v[s].size();
  cnt2++;
  for (int i = 0; i < v[s].size(); i++) {
    if (!vis[v[s][i]]) dfs(v[s][i]);
  }
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, b, ans = 0, ans2, x, y, z, i, s;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      cnt = 0;
      cnt2 = 0;
      dfs(i);
      if (cnt2 * 2 == cnt) {
        if (cnt2 % 2) ans++;
      }
    }
  }
  if ((n - ans) % 2 == 0)
    cout << ans;
  else
    cout << ans + 1;
  return 0;
}
