#include <bits/stdc++.h>
using namespace std;
vector<int> adj[105];
bool visited[105] = {false};
int colour[105] = {0};
int temp = 0;
void dfs(int n, int c) {
  if (colour[n] != c && visited[n]) {
    temp++;
    return;
  }
  if (visited[n]) return;
  visited[n] = true;
  colour[n] = c;
  for (int i = 0; i < adj[n].size(); i++) {
    int x = c ^ 1;
    dfs(adj[n][i], x);
  }
}
int main() {
  int n, m, a, b;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  int ans = 0;
  for (int i = 1; i < n + 1; i++) {
    if (visited[i]) continue;
    temp = 0;
    dfs(i, 0);
    ans += (temp / 2);
  }
  int rem = n - ans;
  if (rem % 2 == 1) ans++;
  cout << ans;
}
