#include <bits/stdc++.h>
using namespace std;
int n, m, ans;
int fa[1111111], du[1111111], s[1111111], s2[1111111], fk[1111111];
int find(int x) { return (x == fa[x]) ? (x) : (fa[x] = find(fa[x])); }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) fa[i] = i;
  for (int i = 1; i <= m; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    du[x] ^= 1;
    du[y] ^= 1;
    x = find(x), y = find(y);
    if (x == y) fk[x] = 1;
    if (x > y) swap(x, y);
    fa[y] = x;
  }
  for (int i = 1; i <= n; ++i) find(i);
  for (int i = 1; i <= n; ++i) {
    s[fa[i]]++;
    s2[fa[i]] += du[i];
  }
  int tot = 0, tot2 = 0, sp = 0;
  for (int i = 1; i <= n; ++i) {
    if (i == 1 || s[i] > 1 || (fk[i] && fa[i] == i)) {
      ans++;
      ans += s2[i] / 2;
      if (s2[i] >= 2) ans--;
      ++tot;
    }
  }
  cout << ans - (tot == 1 && s2[1] == 0) << endl;
}
