#include <bits/stdc++.h>
using namespace std;
int read() {
  int ans = 0;
  int flag = 1;
  char ch = getchar();
  while ((ch > '9' || ch < '0') && ch != '-') ch = getchar();
  if (ch == '-') flag = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') ans = ans * 10 + ch - '0', ch = getchar();
  return ans * flag;
}
const int maxn = 1000010;
int n, m, ans;
int num[maxn], flag[maxn];
int pre[maxn], vis[maxn];
int find(int x) {
  if (x != pre[x]) {
    pre[x] = find(pre[x]);
  }
  return pre[x];
}
void Union(int x, int y) {
  int fx = find(x);
  int fy = find(y);
  if (fx != fy) pre[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++) pre[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;
}
