#include <bits/stdc++.h>
using namespace std;
int n, m, E, l[1000005], qd[2000005], qn[2000005], v[1000005], cpn,
    odd[1000005], deg[1000005], siz[1000005], st = 0;
void bd(int x, int y) {
  qd[E] = y;
  qn[E] = l[x];
  l[x] = E++;
}
void DFS(int x) {
  v[x] = cpn;
  siz[cpn] += deg[x];
  if (deg[x] & 1) odd[cpn]++;
  for (int k = l[x]; k != -1; k = qn[k])
    if (v[qd[k]] == -1) DFS(qd[k]);
}
int main() {
  scanf("%d%d", &n, &m);
  if (m == 0) {
    printf("0\n");
    return 0;
  }
  memset(l, -1, sizeof(l));
  E = 0;
  memset(deg, 0, sizeof(deg));
  cpn = 0;
  while (m--) {
    int x, y;
    scanf("%d%d", &x, &y);
    bd(x, y);
    bd(y, x);
    deg[x]++;
    deg[y]++;
    if (x == 1 || y == 1) st = 1;
  }
  memset(v, -1, sizeof(v));
  for (int i = (1); i <= (n); i++)
    if (v[i] == -1) {
      odd[cpn] = 0;
      siz[cpn] = 0;
      DFS(i);
      cpn++;
    }
  int ret = 0, tt = 0, r;
  if (st == 0) odd[cpn] = 0, siz[cpn] = 1, cpn++;
  for (int i = (0); i < (cpn); i++)
    if (siz[i] > 0) tt++;
  if (tt == 1) {
    for (int i = (0); i < (cpn); i++)
      if (siz[i] > 0) printf("%d\n", odd[i] / 2);
    return 0;
  }
  for (int i = (0); i < (cpn); i++)
    if (odd[i] == 0 && siz[i] > 0) odd[i] = 2;
  r = ret = tt;
  for (int i = (0); i < (cpn); i++)
    if (r && odd[i] >= 2) odd[i] -= 2, r--;
  for (int i = (0); i < (cpn); i++) ret += odd[i] / 2;
  printf("%d\n", ret);
  return 0;
}
