#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:200000000")
const double EPS = 1E-9;
const int INF = 1000000000;
const long long INF64 = (long long)1E18;
const double PI = 3.1415926535897932384626433832795;
const int NMAX = 1100000;
vector<int> g[NMAX], s[NMAX];
int c[NMAX];
void dfs(int v, int col) {
  c[v] = col;
  s[col].push_back(v);
  for (int i = 0; i < (int)(g[v].size()); i++)
    if (c[g[v][i]] == -1) dfs(g[v][i], col);
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < (int)(m); i++) {
    int v1, v2;
    scanf("%d%d", &v1, &v2);
    v1--;
    v2--;
    g[v1].push_back(v2);
    g[v2].push_back(v1);
  }
  memset(c, -1, sizeof(c));
  int cnt = 0;
  for (int i = 0; i < (int)(n); i++)
    if (c[i] == -1) dfs(i, cnt++);
  vector<int> a;
  for (int i = 0; i < (int)(cnt); i++) {
    if ((int)s[i].size() == 1 && g[s[i][0]].empty() && s[i][0] != 0) continue;
    int k = 0;
    for (int j = 0; j < (int)(s[i].size()); j++) {
      int v = s[i][j];
      if ((int)g[v].size() % 2 == 1) k++;
    }
    a.push_back(k);
  }
  if (a.empty()) {
    puts("0");
    return 0;
  }
  if ((int)a.size() == 1) {
    printf("%d\n", a[0] / 2);
    return 0;
  }
  int ans = 0;
  for (int i = 0; i < (int)(a.size()); i++) {
    a[i] = max(a[i], 2);
    ans += a[i] / 2;
  }
  cout << ans << endl;
  return 0;
}
