#include <bits/stdc++.h>
using namespace std;
namespace zzc {
inline int read() {
  int 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 maxn = 1e6 + 5;
int n, m, cnt, ans;
int deg[maxn];
bool con[maxn], odd, flag, vis[maxn];
vector<int> e[maxn];
void dfs(int u) {
  vis[u] = true;
  if (deg[u] & 1) flag = true;
  for (auto v : e[u])
    if (!vis[v]) dfs(v);
}
void work() {
  int a, b;
  n = read();
  m = read();
  for (int i = 1; i <= m; i++) {
    a = read();
    b = read();
    con[a] = con[b] = true;
    e[a].push_back(b);
    e[b].push_back(a);
    deg[a]++;
    deg[b]++;
  }
  con[1] = 1;
  for (int i = 1; i <= n; i++) {
    if (deg[i] & 1) {
      ans++;
      odd = true;
    } else if (!vis[i] && con[i]) {
      cnt++;
      flag = false;
      dfs(i);
      if (!flag) ans += 2;
    }
  }
  if (odd == false && cnt == 1) ans = 0;
  printf("%d\n", ans / 2);
}
}  // namespace zzc
int main() {
  zzc::work();
  return 0;
}
