#include <bits/stdc++.h>
using namespace std;
map<int, double> code;
map<int, int> m1, m2, m3;
int root[154];
int vis[245];
int find(int x) { return root[x] == x ? x : find(root[x]); }
int main() {
  int a, b, c, d, e, f, g, h, i, j, k, l = 0, p, n, m;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    root[i] = i;
    vis[i] = 1;
  }
  for (i = 1; i <= m; i++) {
    cin >> a;
    cin >> b;
    f = find(a);
    g = find(b);
    if (f == g && vis[f] % 2 == 1) {
      l++;
    }
    root[g] = root[f];
    vis[f] = vis[f] + vis[g];
  }
  if ((n - l) % 2 == 1) {
    l++;
  }
  cout << l << '\n';
}
