#include <bits/stdc++.h>
using namespace std;
int n, m, cnt1, cnt2, i, j;
bool vis[105];
vector<int> v[105];
pair<int, int> dfs(int a) {
  pair<int, int> ans = pair<int, int>(1, v[a].size());
  vis[a] = 1;
  for (int i = 0; i < v[a].size(); i++) {
    int nei = v[a][i];
    if (!vis[nei]) {
      pair<int, int> k = dfs(nei);
      ans.first += k.first;
      ans.second += k.second;
    }
  }
  return ans;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 0; i < n; i++) {
    if (!vis[i]) {
      pair<int, int> a = dfs(i);
      if (a.first & 1) {
        if (a.second / 2 == a.first - 1)
          cnt1++;
        else
          cnt2++;
      }
    }
  }
  cout << cnt2 + cnt1 % 2 << endl;
  return 0;
}
