#include <bits/stdc++.h>
using namespace std;
const int row[] = {-1, -1, -1, 0, 0, 1, 1, 1};
const int col[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int ar[106][106], n, len, par[106];
bool vis[106];
void find_cycle_length(int u) {
  vis[u] = 1;
  for (int i = 1; i <= n; i++) {
    if (!vis[i] && ar[u][i] && i != par[u]) {
      par[i] = u;
      find_cycle_length(i);
    } else if (vis[i] && ar[u][i] && i != par[u]) {
      int q = par[u];
      while (q != -1) {
        q = par[q];
        len++;
      }
    }
  }
}
int main() {
  int i, j, k, a, b, c, d;
  int m;
  cin >> n >> m;
  memset(ar, 0, sizeof(ar));
  memset(vis, 0, sizeof(vis));
  memset(par, -1, sizeof(par));
  for (i = 0; i < m; i++) {
    cin >> a >> b;
    ar[a][b] = ar[b][a] = 1;
  }
  int cnt = 0;
  for (i = 1; i <= n; i++) {
    if (!vis[i]) {
      len = 1;
      find_cycle_length(i);
      if (len != 1 && len & 1) cnt++;
    }
  }
  int unequal = (n - cnt) & 1;
  cout << cnt + unequal << endl;
  return 0;
}
