#include <bits/stdc++.h>
const int N = 1000000 + 9;
struct node {
  int link, next;
} es[N * 2];
int son[N], ec, n, m, d[N], cnt, tmp;
bool vis[N];
void addedge(const int x, const int y) {
  es[++ec].link = y;
  es[ec].next = son[x];
  son[x] = ec;
}
void Addedge(const int x, const int y) {
  addedge(y, x);
  addedge(x, y);
}
void dfs(const int u) {
  vis[u] = 1;
  if (d[u] & 1) ++cnt;
  for (int i = son[u]; i; i = es[i].next)
    if (!vis[es[i].link]) dfs(es[i].link);
}
int main() {
  scanf("%d%d", &n, &m);
  while (m--) {
    int x, y;
    scanf("%d%d", &x, &y);
    ++d[x];
    ++d[y];
    Addedge(x, y);
  }
  int num = 0, cnt2 = 0;
  for (int i = 1; i <= n; ++i)
    if (!vis[i] && (d[i] || i == 1)) {
      dfs(i);
      ++num;
      if (tmp == cnt) cnt2 += 2;
      tmp = cnt;
    }
  if (num > 1) cnt += cnt2;
  printf("%d\n", cnt / 2);
}
