#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, m;
vector<int> c[1000010];
vector<int> b;
bool vis[1000010];
int cnt, trail, flag;
void dfs(int u) {
  vis[u] = true;
  if (u == 1) flag = true;
  if (c[u].size() % 2 == 1) cnt++;
  int v;
  for (int i = 0; i < c[u].size(); i++) {
    v = c[u][i];
    trail++;
    if (!vis[v]) dfs(v);
  }
}
int solve() {
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    if (vis[i]) continue;
    cnt = 0, trail = 0, flag = 0;
    dfs(i);
    if (!trail && !flag) continue;
    b.push_back(cnt);
  }
  if (b.size() == 1) return b[0] / 2;
  for (int i = 0; i < b.size(); i++) {
    if (b[i] == 0) b[i] = 2;
    sum += b[i];
  }
  return sum / 2;
}
int main() {
  n = read();
  m = read();
  for (int i = 0; i < m; i++) {
    int v, u;
    v = read();
    u = read();
    c[v].push_back(u);
    c[u].push_back(v);
  }
  int ans = solve();
  printf("%d", ans);
  return 0;
}
