#include <bits/stdc++.h>
using namespace std;
const int N = int(1e6) + 5;
int f[N], n, m, deg[N], eulerian[N], csize[N];
int find(int x) { return (f[x] == x) ? x : (f[x] = find(f[x])); }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) f[i] = i, eulerian[i] = 1;
  for (int i = 1; i <= m; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    f[find(a)] = find(b);
    ++deg[a];
    ++deg[b];
  }
  int ccc(0), cnecc(0), cocc(0);
  for (int i = 1; i <= n; ++i) ++csize[find(i)];
  for (int i = 1; i <= n; ++i)
    if (deg[i] & 1) eulerian[find(i)] = 0, cocc++;
  for (int i = 1; i <= n; ++i)
    if (find(i) == i && (i == 1 || csize[i] > 1 || deg[i] > 0)) {
      ++ccc;
      if (!eulerian[i]) ++cnecc;
    }
  printf("%d\n", cocc / 2 + (ccc == 1 ? 0 : ccc - cnecc));
  return 0;
}
