#include <bits/stdc++.h>
using namespace std;
const int maxN = 105;
int parent[maxN], r[maxN];
void build(int n) {
  for (int i = 0; i <= n; i++) {
    parent[i] = i;
    r[i] = 1;
  }
}
int find(int n) {
  if (parent[n] == n) return n;
  return parent[n] = find(parent[n]);
}
int disjoint(int a, int b) {
  int v = find(a);
  int u = find(b);
  if (v != u) {
    if (r[v] > r[u]) {
      r[v] += r[u];
      parent[u] = v;
    } else {
      r[u] += r[v];
      parent[v] = u;
    }
    return 0;
  }
  return v;
}
int main() {
  int n, m, x, y, ans = 0;
  cin >> n >> m;
  build(n);
  while (m--) {
    cin >> x >> y;
    int u = disjoint(x, y);
    if (u != 0 && r[u] % 2 == 1) ++ans;
  }
  if ((n - ans) & 1) ++ans;
  cout << ans << '\n';
  return 0;
}
