#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
int n;
int m;
int was[1000000];
vector<int> v[1000000];
int cnt[1000000];
multiset<int> all;
int go(int x) {
  was[x] = 1;
  int tmp = cnt[x] & 1;
  for (int i = 0; i < ((int)(v[x]).size()); i++)
    if (!was[v[x][i]]) tmp += go(v[x][i]);
  return tmp;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    v[a].push_back(b);
    v[b].push_back(a);
    cnt[a]++;
    cnt[b]++;
  }
  for (int i = 0; i < n; i++)
    if (!was[i] && (i == 0 || ((int)(v[i]).size()) > 0)) all.insert(-go(i));
  int ans = 0;
  while (((int)(all).size()) > 1) {
    int a = -*all.begin();
    all.erase(all.begin());
    int b = -*all.begin();
    all.erase(all.begin());
    if (b == 0) {
      all.insert(-a);
      all.insert(-b);
      break;
    }
    ans++;
    all.insert(-(a + b - 2));
  }
  int x = -*all.begin();
  int y = ((int)(all).size());
  if (y > 1) {
    if (x > 0) x -= 2;
    ans += x / 2 + y;
  } else {
    ans += x / 2;
  }
  printf("%d\n", ans);
  return 0;
}
