#include <bits/stdc++.h>
using namespace std;
int head[2020202], to[2020202], nxt[2020202];
int tot;
int r[2020020];
int f[2202022];
int cnt = 0;
int v[2020202];
int flag;
void dfs(int x) {
  v[x] = 1;
  if (r[x] % 2 == 1) flag = 1;
  for (int i = head[x]; i; i = nxt[i]) {
    int y = to[i];
    if (v[y] == 0) dfs(y);
  }
}
inline long long read() {
  char ch = getchar();
  long long x = 0, f = 1;
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
void add(int x, int y) {
  tot++;
  to[tot] = y;
  nxt[tot] = head[x];
  head[x] = tot;
}
int main() {
  int n = read(), m = read();
  for (int i = 1; i <= m; i++) {
    int x = read(), y = read();
    f[x] = f[y] = 1;
    r[x]++;
    r[y]++;
    add(x, y);
    add(y, x);
  }
  f[1] = 1;
  int ans = 0, ff = 0;
  for (int i = 1; i <= n; i++) {
    if (r[i] % 2 == 1) {
      ans++;
      ff = 1;
    } else {
      if (v[i] == 0 && f[i]) {
        cnt++;
        flag = 0;
        dfs(i);
        if (flag == 0) ans += 2;
      }
    }
  }
  if (ff == 0 && cnt == 1) ans -= 2;
  cout << ans / 2;
  return 0;
}
