#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100000 + 5];
int vis[100000 + 5], elements;
int deg[100000 + 5];
bool flag;
void dfs(int u) {
  vis[u]++;
  elements++;
  if (deg[u] < 2) flag = 1;
  for (int v : adj[u]) {
    if (!vis[v]) dfs(v);
  }
}
int main() {
  int T;
  T = 1;
  for (int t = 1; t <= T; t++) {
    int n;
    cin >> n;
    int e;
    cin >> e;
    for (int i = 1; i <= e; i++) {
      int u, v;
      cin >> u >> v;
      adj[u].push_back(v);
      adj[v].push_back(u);
      deg[u]++;
      deg[v]++;
    }
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
      flag = 0;
      if (!vis[i]) {
        elements = 0;
        dfs(i);
        if (!flag) {
          if (elements & 1) cnt++;
        }
      }
    }
    if ((n + cnt) % 2 == 1)
      cout << cnt + 1;
    else
      cout << cnt;
  }
}
