#include <bits/stdc++.h>
using namespace std;
int n, m, ans;
int num[1000010], flag[1000010];
int fa[1000010], vis[1000010];
int Find(int x) { return fa[x] = x == fa[x] ? x : Find(fa[x]); }
void Union(int x, int y) {
  int fx = Find(x);
  int fy = Find(y);
  if (fx != fy) fa[fy] = fx;
}
int main() {
  int t, C = 1;
  while (scanf("%d%d", &n, &m) != EOF) {
    memset(num, 0, sizeof(num));
    memset(flag, 0, sizeof(flag));
    memset(vis, 0, sizeof(vis));
    for (int i = 1; i <= n; i++) fa[i] = i;
    int u, v;
    vis[1] = 1;
    for (int i = 0; i < m; i++) {
      scanf("%d%d", &u, &v);
      if (u != v) {
        num[u]++;
        num[v]++;
        vis[u]++;
        vis[v]++;
        Union(u, v);
      } else
        vis[u]++;
    }
    int ans = 0, k = 0, tong = 0;
    for (int i = 1; i <= n; i++)
      if (num[i] & 1) flag[Find(i)]++;
    for (int i = 1; i <= n; i++)
      if (vis[i] && Find(i) == i) {
        if (flag[i])
          ans += flag[i];
        else
          tong++;
        k++;
      }
    if (k == 1)
      printf("%d\n", ans / 2);
    else
      printf("%d\n", ans / 2 + tong);
  }
  return 0;
}
