#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int res = 0;
  char c;
  bool flag = true;
  c = getchar();
  while (!isdigit(c)) {
    if (c == '-') flag = false;
    c = getchar();
  }
  while (isdigit(c)) {
    res = res * 10 + (c ^ 48);
    c = getchar();
  }
  return flag ? res : -res;
}
const int Max_n = 1e6 + 5;
int in[Max_n], fa[Max_n], n, m, u, v, ji[Max_n], ans, tot;
bool vis[Max_n], flag;
inline int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
inline void merge(int x, int y) {
  fa[find(x)] = find(y);
  vis[find(y)] = true;
}
int main() {
  n = read(), m = read();
  vis[1] = true;
  for (int i = 1; i <= n; ++i) fa[i] = i;
  for (int i = 1; i <= m; ++i) {
    u = read(), v = read();
    ++in[u], ++in[v];
    merge(u, v);
  }
  for (int i = 1; i <= n; ++i)
    if (in[i] % 2) ++ji[find(i)];
  for (int i = 1; i <= n; ++i)
    if (find(i) == i && vis[i]) ++tot;
  if (tot == 1) {
    printf("%d", ji[find(1)] / 2);
    return 0;
  }
  for (int i = 1; i <= n; ++i)
    if (find(i) == i && vis[i]) {
      if (ji[i])
        ans += ji[i] / 2;
      else
        ++ans;
    }
  printf("%d", ans);
  return 0;
}
