#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * f;
}
const int N = 1e6 + 5;
int n, m, cnt, ans;
vector<int> G[N];
bool d[N], vis[N], point[N], flg, odd;
void dfs(int u) {
  vis[u] = 1;
  if (d[u]) odd = 1;
  for (int v : G[u])
    if (!vis[v]) {
      dfs(v);
    }
}
int main() {
  n = read(), m = read();
  for (int i = (1); i <= (m); ++i) {
    int u = read(), v = read();
    G[u].push_back(v);
    G[v].push_back(u);
    d[u] ^= 1, d[v] ^= 1;
    point[u] = point[v] = 1;
  }
  point[1] = 1;
  for (int i = (1); i <= (n); ++i) {
    if (d[i])
      ans++, flg = 1;
    else if (!vis[i] && point[i]) {
      cnt++;
      odd = 0;
      dfs(i);
      if (!odd) ans += 2;
    }
  }
  if (!flg && cnt == 1) ans = 0;
  printf("%d\n", ans / 2);
  return 0;
}
