#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000005;
const double eps = 1e-8;
int n, m;
int degree[maxn];
int fa[maxn];
bool v[maxn];
int cnt[maxn];
bool vis[maxn];
int find(int a) {
  if (fa[a] != a) fa[a] = find(fa[a]);
  return fa[a];
}
bool cmp(int a, int b) { return a > b; }
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) fa[i] = i;
  int x, y;
  while (m--) {
    scanf("%d %d", &x, &y);
    vis[x] = vis[y] = true;
    int pa = find(x);
    int pb = find(y);
    if (pa != pb) fa[pa] = pb;
    degree[x]++;
    degree[y]++;
  }
  v[find(1)] = true;
  for (int i = 1; i <= n; i++)
    if (vis[i]) v[find(i)] = true;
  for (int i = 1; i <= n; i++)
    if (degree[i] & 1) cnt[find(i)]++;
  vector<int> vec;
  for (int i = 1; i <= n; i++)
    if (v[i]) vec.push_back(cnt[i]);
  m = vec.size();
  if (m == 1) {
    printf("%d\n", vec[0] / 2);
    return 0;
  }
  int ans = m;
  for (int i = 0; i < m; i++) ans += max(0, vec[i] / 2 - 1);
  printf("%d\n", ans);
  return 0;
}
