#include <bits/stdc++.h>
const int N = 1e5 + 5;
using namespace std;
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int n, m, cntnodes = 0, cycles = 0;
bool vis[105];
vector<int> v[105];
void dfs(int s) {
  if (vis[s]) return;
  vis[s] = 1;
  cntnodes++, cycles += v[s].size();
  for (auto i : v[s]) {
    if (!vis[i]) {
      dfs(i);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b), v[b].push_back(a);
  }
  int ans = 0;
  for (long long i = 1; i <= n; i++) {
    cntnodes = cycles = 0;
    if (!vis[i]) dfs(i);
    if (cntnodes & 1 && cntnodes * 2 == cycles) ans++;
  }
  if ((n - ans) & 1) ans++;
  cout << ans;
}
