#include <bits/stdc++.h>
using namespace std;
namespace FGF {
int n, m;
const int N = 1e6 + 5;
int du[N], u[N], v[N], fa[N], a[N], cnt, ans, vis[N], tot;
int find(int x) { return x == fa[x] ? x : fa[x] = find(fa[x]); }
void work() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++)
    scanf("%d%d", &u[i], &v[i]), du[u[i]]++, du[v[i]]++,
        vis[u[i]] = vis[v[i]] = 1;
  for (int i = 1; i <= n; i++) cnt += du[i] & 1, fa[i] = i, a[i] = du[i] & 1;
  if (cnt & 1) {
    puts("0");
    return;
  }
  for (int i = 1; i <= m; i++) {
    int x = find(u[i]), y = find(v[i]);
    if (x != y) fa[x] = y, a[y] |= a[x];
  }
  for (int i = 1; i <= n; i++)
    if (find(i) == i && !a[i] && (vis[i] || i == 1)) ans++;
  for (int i = 1; i <= n; i++)
    if (find(i) == i && (vis[i] || i == 1)) tot++;
  if (tot == 1)
    printf("%d ", cnt / 2);
  else
    printf("%d", ans + cnt / 2);
}
}  // namespace FGF
int main() {
  FGF::work();
  return 0;
}
