#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int w = 0, x = 0;
  char c = getchar();
  while (!isdigit(c)) w |= c == '-', c = getchar();
  while (isdigit(c)) x = x * 10 + (c ^ 48), c = getchar();
  return w ? -x : x;
}
namespace star {
const int maxn = 1e6 + 10;
int n, m, N, cnt[maxn];
int ecnt, u[maxn], v[maxn], fa[maxn], in[maxn];
int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
inline void work() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++) fa[i] = i;
  for (int i = 1; i <= m; i++) in[u[i] = read()]++, in[v[i] = read()]++;
  int ans = 0;
  for (int i = 1; i <= n; i++) ans += (in[i] & 1);
  ans >>= 1;
  for (int i = 1; i <= m; i++) {
    int u = find(star::u[i]), v = find(star::v[i]);
    if (u != v) fa[u] = v, in[v] |= in[u];
  }
  for (int i = 1; i <= n; i++)
    if (find(i) == i and (in[i] or i == 1)) N++;
  if (N != 1)
    for (int i = 1; i <= n; i++)
      ans += find(i) == i and (in[i] or i == 1) and !(in[i] & 1);
  printf("%d\n", ans);
}
}  // namespace star
signed main() {
  star::work();
  return 0;
}
