#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
inline int read() {
  int s = 0;
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) s = (s << 3) + (s << 1) + (c ^ 48), c = getchar();
  return s;
}
int n, m, tot, fa[N], sz[N], odd[N], dg[N], ans, nd[N], ed;
bool in[N], hv;
int find(int p) { return fa[p] == p ? p : fa[p] = find(fa[p]); }
inline int merge(int x, int y) {
  if (sz[x] < sz[y]) swap(x, y);
  fa[y] = x;
  sz[x] += sz[y];
  odd[x] += odd[y];
  return x;
}
inline void connect(int x, int y) {
  ans++;
  if (!odd[x])
    odd[x]++;
  else
    odd[x]--;
  if (!odd[y])
    odd[y]++;
  else
    odd[y]--;
}
int main() {
  n = read(), m = read();
  for (register int i = 1; i <= n; i++) fa[i] = i, sz[i] = 1;
  while (m--) {
    int x = read(), y = read(), xx = find(x), yy = find(y);
    if (xx != yy) xx = merge(xx, yy);
    if (dg[x] & 1)
      odd[xx]--;
    else
      odd[xx]++;
    dg[x]++;
    if (dg[y] & 1)
      odd[xx]--;
    else
      odd[xx]++;
    dg[y]++;
  }
  for (register int i = 1; i <= n; i++) {
    int x = find(i);
    if (in[x]) continue;
    if (x == i && !dg[i]) continue;
    nd[++ed] = x;
    in[x] = 1;
  }
  if (!in[find(1)]) nd[++ed] = find(1);
  for (register int i = 1; i < ed; i++) connect(nd[i], nd[i + 1]);
  for (register int i = 1; i <= ed; i++) tot += odd[nd[i]];
  cout << (tot >> 1) + ans;
  return 0;
}
