#include <bits/stdc++.h>
using namespace std;
const int M = 1000500;
int n, m;
bool vis[M];
int fa[M], deg[M], in[M];
inline int read() {
  int x = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x;
}
inline int find(int x) {
  if (x != fa[x]) return fa[x] = find(fa[x]);
  return x;
}
inline void unionn(int a, int b) {
  int r1 = find(a), r2 = find(b);
  if (r1 != r2) fa[r2] = r1;
  return;
}
inline void constt() {
  for (int i = 1; i <= n; i++) fa[i] = i, vis[i] = in[i] = deg[i] = 0;
  return;
}
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    constt();
    vis[1] = 1;
    for (int i = 1; i <= m; i++) {
      int u = read(), v = read();
      if (u != v) {
        in[u]++, in[v]++;
        vis[u] = vis[v] = 1;
        unionn(u, v);
      } else
        vis[u] = 1;
    }
    for (int i = 1; i <= n; i++)
      if (in[i] & 1) deg[find(i)]++;
    int ans = 0, que = 0, cnt = 0;
    for (int i = 1; i <= n; i++)
      if (vis[i] && find(i) == i) {
        if (deg[i])
          ans += deg[i];
        else
          que++;
        cnt++;
      }
    if (cnt == 1)
      printf("%d\n", ans / 2);
    else
      printf("%d\n", ans / 2 + que);
  }
  return 0;
}
