#include <bits/stdc++.h>
using namespace std;
inline long long pow(long long a, long long b, long long mo) {
  if (!a) return 0;
  long long tmp = 1;
  for (; b; b >>= 1) {
    if (b & 1) tmp = (long long)tmp * a % mo;
    a = (long long)a * a % mo;
  }
  return tmp;
}
template <class T>
inline void R(T &xx) {
  xx = 0;
  char ch = getchar();
  bool F = 0;
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') F = 1, ch = getchar();
  while (ch >= '0' && ch <= '9')
    xx = xx + xx + (xx << 3) + ch - 48, ch = getchar();
  if (F) xx = -xx;
}
int f[2000011], d[2000011], s[2000011], ans, cnt, n, m, x, y;
int find(int x) { return f[x] == x ? x : f[x] = find(f[x]); }
int main() {
  R(n), R(m);
  for (int i = (1); i <= (n); i++) f[i] = i;
  d[1] = 2;
  for (int i = (1); i <= (m); i++)
    R(x), R(y), f[find(x)] = find(y), d[x]++, d[y]++;
  for (int i = (1); i <= (n); i++)
    if (d[i] & 1) s[find(i)] = 1, ans++;
  for (int i = (1); i <= (n); i++)
    if (find(i) == i && d[i] && !s[i]) ans += 2;
  if (ans == 2 && !s[find(1)]) ans = 0;
  printf("%d\n", ans >> 1);
  return 0;
}
