#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000005;
struct edge {
  int a, l;
} e[maxN * 2];
int n, m, tot, cnt, d[maxN], heap[maxN], start[maxN], q[maxN];
bool vis[maxN];
inline void add(int x, int y) {
  ++d[x];
  ++d[y];
  e[++tot].l = start[x];
  e[tot].a = y;
  start[x] = tot;
  e[++tot].l = start[y];
  e[tot].a = x;
  start[y] = tot;
}
void Init() {
  int x, y;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &x, &y);
    add(x, y);
  }
}
void bfs(int x) {
  int h = 0, t = 0;
  q[++t] = x;
  vis[x] = 1;
  while (h != t) {
    x = q[++h];
    if (d[x] & 1) ++cnt;
    for (int i = start[x]; i; i = e[i].l)
      if (!vis[e[i].a]) {
        q[++t] = e[i].a;
        vis[e[i].a] = 1;
      }
  }
}
void Work() {
  int t = 0, x, y, z, ans = 0;
  for (int i = 1; i <= n; ++i)
    if (!vis[i]) {
      if (d[i] == 0 && i != 1) continue;
      cnt = 0;
      bfs(i);
      heap[++t] = cnt;
      push_heap(heap + 1, heap + 1 + t);
    }
  while (t > 1) {
    ++ans;
    x = heap[1];
    pop_heap(heap + 1, heap + 1 + t);
    --t;
    y = heap[1];
    pop_heap(heap + 1, heap + 1 + t);
    --t;
    z = x + y;
    if (x)
      --z;
    else
      ++z;
    if (y)
      --z;
    else
      ++z;
    heap[++t] = z;
    push_heap(heap + 1, heap + 1 + t);
  }
  cnt = 0;
  for (int i = 1; i <= t; ++i) cnt += heap[i];
  ans += cnt / 2;
  cout << ans << endl;
}
int main() {
  Init();
  Work();
  return 0;
}
