#include <bits/stdc++.h>
using namespace std;
int father[1000010], deg[1000010], c[1000010], n, m;
int Find(int p) {
  if (father[p] == p) return p;
  father[p] = Find(father[p]);
  return father[p];
}
void read() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; ++i) father[i] = i;
  deg[1] = 2;
  for (int i = 1, a, b; i <= m; ++i) {
    scanf("%d %d", &a, &b);
    ++deg[a], ++deg[b];
    father[Find(a)] = Find(b);
  }
}
int solve() {
  int sum = 0;
  for (int i = 1; i <= n; ++i)
    sum = sum + (deg[i] & 1), c[Find(i)] = c[Find(i)] | (deg[i] & 1);
  for (int i = 1; i <= n; ++i)
    if (father[i] == i && deg[i] && !c[i]) sum += 2;
  if (c[father[1]] == 0 && sum == 2) sum = 0;
  return sum >> 1;
}
int main() {
  read();
  printf("%d\n", solve());
  return 0;
}
