#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 9;
int n, m, d[MAX], k[MAX], f[MAX], ans;
int root(int v) { return f[v] == v ? v : f[v] = root(f[v]); }
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) f[i] = i;
  d[1] = 2;
  for (int i = 0, v, u; i < m; i++)
    cin >> v >> u, d[v]++, d[u]++, f[root(v)] = root(u);
  for (int i = 1; i <= n; i++) ans += d[i] % 2, k[root(i)] |= d[i] % 2;
  for (int i = 1; i <= n; i++)
    if (f[i] == i && d[i] && !k[i]) ans += 2;
  if (!k[f[1]] && ans == 2) ans = 0;
  cout << ans / 2;
}
