#include <bits/stdc++.h>
using namespace std;
long long m, n;
vector<vector<int>> adj(120, vector<int>(120, 0));
vector<bool> vis(120, false);
vector<int> color(120, 0);
long long cnt = 0;
void dfs(int v, int c) {
  color[v] = c;
  vis[v] = true;
  for (int i = 1; i <= n; i++) {
    if (adj[v][i] == 1 and !vis[i]) {
      dfs(i, !c);
    } else if (adj[v][i] == 1 and vis[i]) {
      if (color[v] == color[i]) cnt++;
    }
  }
}
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    long long x, y;
    cin >> x >> y;
    adj[x][y] = 1;
    adj[y][x] = 1;
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) dfs(i, 0);
  cnt /= 2;
  if ((n - cnt) % 2) cnt++;
  cout << cnt << endl;
}
