#include <bits/stdc++.h>
using namespace std;
const int N = 2000005;
const int M = 1000000007;
int n, m;
int a, b;
int d[N];
int pa[N], ran[N];
int vis[N], cnt[N];
set<int> st;
void ini() {
  memset(d, 0, sizeof(d));
  memset(vis, 0, sizeof(vis));
  memset(cnt, 0, sizeof(cnt));
  for (int i = 0; i <= n; i++) pa[i] = i, ran[i] = 1;
  st.clear();
  vis[1] = 2;
}
int find(int x) {
  if (x == pa[x]) return x;
  return pa[x] = find(pa[x]);
}
void uni(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y) return;
  if (ran[x] < ran[y])
    pa[x] = pa[y];
  else {
    pa[y] = pa[x];
    if (ran[x] == ran[y]) ran[x]++;
  }
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    ini();
    for (int i = 0; i < m; i++) {
      scanf("%d%d", &a, &b);
      vis[a] = vis[b] = 1;
      if (a != b) {
        d[a]++;
        d[b]++;
      }
      uni(a, b);
    }
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      if (vis[i]) {
        st.insert(find(i));
        if (d[i] % 2) cnt[find(i)]++;
      }
    }
    ans += st.size() == 1 ? 0 : st.size();
    if (st.size() > 1) {
      for (int i = 1; i <= n; i++) {
        if (cnt[i] > 2) ans += (cnt[i] - 2) / 2;
      }
    } else {
      for (int i = 1; i <= n; i++)
        if (d[i] % 2) ans++;
      ans /= 2;
      if (vis[1] == 2) ans += 2;
    }
    if (m == 0) ans = 0;
    printf("%d\n", ans);
  }
  return 0;
}
