#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000500;
int n, m, vis[maxn], flag, du[maxn], point[maxn], cnt, ans;
vector<int> e[maxn];
void dfs(int u) {
  vis[u] = 1;
  if (du[u] & 1) flag = 1;
  for (int i = 0; i < e[u].size(); i++) {
    if (vis[e[u][i]] == 0) dfs(e[u][i]);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    point[u] = point[v] = 1;
    if (u == v) continue;
    e[u].push_back(v);
    e[v].push_back(u);
    du[u]++, du[v]++;
  }
  point[1] = 1;
  int jidian = 0;
  for (int i = 1; i <= n; i++) {
    if (du[i] & 1) {
      ans++;
      jidian = 1;
    } else if (vis[i] == 0 && point[i] == 1) {
      cnt++;
      flag = 0;
      dfs(i);
      if (flag == 0) ans += 2;
    }
  }
  if (jidian == 0 && cnt == 1) ans = 0;
  printf("%d", ans / 2);
  return 0;
}
