#include <bits/stdc++.h>
using namespace std;
const int limit = 1000000 + 5;
int d[limit], fa[limit];
int find(int x) { return x == fa[x] ? x : fa[x] = find(fa[x]); }
bool vis[limit], flag[limit];
void Union(int x, int y) {
  x = find(x);
  y = find(y);
  if (x != y) fa[x] = y;
}
int main() {
  int n, m;
  cin >> n >> m;
  vis[1] = 1;
  for (int i = 1; i <= n; i++) {
    fa[i] = i;
  }
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    vis[x] = vis[y] = 1;
    d[x]++;
    d[y]++;
    Union(x, y);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (d[i] & 1) {
      ans += 1;
      flag[find(i)] = 1;
    }
  }
  int tot = 0, an = 0;
  for (int i = 1; i <= n; i++) {
    if (vis[i] && find(i) == i) {
      if (!flag[i]) an++;
      tot++;
    }
  }
  if (tot == 1)
    cout << ans / 2;
  else
    cout << ans / 2 + an;
}
