#include <bits/stdc++.h>
using namespace std;
bool t[150];
int del = 0;
bool visited[150];
vector<vector<int>> v;
void dfs(int x, bool z) {
  visited[x] = 1;
  t[x] = !z;
  for (int i = 0; i < v[x].size(); i++) {
    int u = v[x][i];
    if (!visited[u])
      dfs(u, t[x]);
    else if (t[x] == t[u])
      del++;
  }
}
int main() {
  int a, b, n, m;
  cin >> n >> m;
  v.resize(n);
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    a = a - 1;
    b = b - 1;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 0; i < m; i++) {
    if (!visited[i]) dfs(i, 0);
  }
  del /= 2;
  if ((n - del) % 2 == 0)
    cout << del;
  else
    cout << del + 1;
  return 0;
}
