#include <bits/stdc++.h>
using namespace std;
bool use[200];
int dan, ans, n, m, num, color[200];
vector<int> b[200];
void dfs(int now) {
  int i, j, total, ano;
  use[now] = true;
  ano = 0;
  total = 0;
  for (i = 0; i < b[now].size(); i++)
    if (use[b[now][i]] && color[b[now][i]] != 0) {
      ano++;
      total += color[b[now][i]];
    }
  if (total == ano || total == -ano) {
    num++;
    if (total > 0)
      color[now] = -1;
    else
      color[now] = 1;
  }
  for (i = 0; i < b[now].size(); i++)
    if (!use[b[now][i]]) {
      dfs(b[now][i]);
    }
}
int main() {
  ifstream fin("B.in");
  int i, j, k, x, y;
  cin >> n >> m;
  for (i = 1; i <= n; i++) b[i].clear();
  for (i = 1; i <= m; i++) {
    cin >> x >> y;
    b[x].push_back(y);
    b[y].push_back(x);
  }
  memset(use, 0, sizeof(use));
  ans = 0;
  for (i = 1; i <= n; i++)
    if (!use[i]) {
      num = 0;
      memset(color, 0, sizeof(color));
      dfs(i);
      ans += num;
    }
  cout << n - ans / 2 * 2 << endl;
  return 0;
}
