#include <bits/stdc++.h>
using namespace std;
long long int bench = 0;
long long int vis[100005];
long long int col[100005];
vector<long long int> v[100005];
void bptest(long long int n, long long int c) {
  vis[n] = 1;
  col[n] = c;
  for (long long int i = 0; i < v[n].size(); i++) {
    long long int child = v[n][i];
    if (vis[child] == 0) {
      if (c == 1) {
        bptest(child, 0);
      } else {
        bptest(child, 1);
      }
    } else {
      if (col[child] == col[n]) {
        bench++;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, e;
  cin >> n >> e;
  for (long long int i = 0; i < e; i++) {
    long long int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (long long int i = 1; i <= n; i++) {
    if (vis[i] == 0) {
      bptest(i, 1);
    }
  }
  bench = bench / 2;
  n = n - bench;
  if (n % 2 == 1) bench++;
  cout << bench << endl;
}
