#include <bits/stdc++.h>
using namespace std;
bool vis[1000012];
int tmp, top, head[1000012], q[1000012], in[1000012];
struct edge {
  int u, v, nxt;
} e[1000012 * 2];
void adde(int, int);
void dfs(int, int);
int main() {
  int i, n, m, u, v, ans = 0, cnt = 0;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= m; ++i) {
    scanf("%d %d", &u, &v);
    adde(u, v);
    adde(v, u);
  }
  for (i = 1; i <= n; ++i)
    if (!vis[i] && (head[i] || i == 1)) {
      ++cnt;
      ++top;
      dfs(i, 0);
      if (q[top] == 0) {
        ans += 2;
      } else
        ans += q[top];
    }
  if (cnt == 1 && q[1] == 0)
    printf("%d", ans / 2 - 1);
  else
    printf("%d\n", ans / 2);
  return 0;
}
void dfs(int u, int fa) {
  int i, v;
  vis[u] = 1;
  if (in[u] & 1) ++q[top];
  for (i = head[u]; i; i = e[i].nxt) {
    v = e[i].v;
    if (vis[v]) continue;
    dfs(v, u);
  }
}
void adde(int u, int v) {
  ++tmp;
  ++in[v];
  e[tmp].u = u;
  e[tmp].v = v;
  e[tmp].nxt = head[u];
  head[u] = tmp;
}
