#include <bits/stdc++.h>
using namespace std;
long n, m, a, b, ar[200][200], ans;
long arp[10000], fl, l;
void dfs(long v, long par) {
  arp[v] = 1;
  l++;
  for (int i = 1; i <= n; i++)
    if (ar[v][i] == 1) {
      if (i == par) continue;
      if (arp[i] == 1) {
        fl = 1;
        return;
      }
      dfs(i, v);
    }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a >> b;
    ar[a][b] = ar[b][a] = 1;
  }
  for (int i = 1; i <= n; i++)
    if (arp[i] == 0) {
      fl = 0;
      l = 0;
      dfs(i, -1);
      if (fl)
        if (l % 2) ++ans;
    }
  n -= ans;
  if (n % 2) ++ans;
  cout << ans << endl;
  cin.get();
  cin.get();
  return 0;
}
