#include <bits/stdc++.h>
using namespace std;
int flag;
int ctr1;
void dfs(list<int> g[], int s, vector<bool> &visited) {
  visited[s] = true;
  ctr1++;
  if (g[s].size() != 2) flag = 1;
  for (auto it : g[s])
    if (!visited[it]) dfs(g, it, visited);
}
int main() {
  int n, m, a, b;
  list<int> g[101];
  cin >> n >> m;
  vector<bool> visited(n + 1, false);
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  int ctr = 0;
  for (int i = 1; i <= n; i++) {
    flag = 0;
    ctr1 = 0;
    if (!visited[i]) {
      dfs(g, i, visited);
      if (flag == 0 && ctr1 % 2 == 1) ctr++;
    }
  }
  if ((n - ctr) % 2 == 0)
    cout << ctr;
  else
    cout << ctr + 1;
}
