#include <bits/stdc++.h>
using namespace std;
const long long MaxN = 1000006;
long long n, m;
struct Edge {
  long long destination, nextEdge;
} edge[MaxN * 2];
long long degree[MaxN], head[MaxN], cntEdge;
bool visited[MaxN], flag, haveEdge[MaxN];
inline long long Read() {
  long long num = 0, op = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') op = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    num = num * 10 + ch - '0';
    ch = getchar();
  }
  return num * op;
}
inline void AddEdge(long long u, long long v) {
  cntEdge++;
  edge[cntEdge].destination = v;
  edge[cntEdge].nextEdge = head[u];
  head[u] = cntEdge;
  degree[v]++;
  haveEdge[v] = true;
}
inline void DFS(long long x) {
  visited[x] = true;
  if (degree[x] & 1) flag = true;
  for (long long i = head[x]; i; i = edge[i].nextEdge) {
    long long des = edge[i].destination;
    if (!visited[des]) DFS(des);
  }
  return;
}
signed main() {
  n = Read(), m = Read();
  if (!m) {
    printf("0");
    return 0;
  }
  for (long long i = 1; i <= m; i++) {
    long long u = Read(), v = Read();
    AddEdge(u, v);
    AddEdge(v, u);
  }
  haveEdge[1] = true;
  long long single = 0, unit = 0, ans = 0;
  for (long long i = 1; i <= n; i++) {
    if (haveEdge[i]) {
      if (!visited[i]) {
        flag = false;
        DFS(i);
        unit++;
        if (!flag) single++;
      }
      if (degree[i] & 1) ans++;
    }
  }
  if (unit >= 2)
    printf("%lld\n", ans / 2 + single);
  else
    printf("%lld\n", ans / 2);
  return 0;
}
