#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1000000 + 20;
vector<int> adj[MAX_N];
int mark[MAX_N];
int id[MAX_N];
vector<int> seq;
int n, m;
int ans;
void readInput() {
  cin >> n >> m;
  for (int i(0); i < int(m); i++) {
    int v, u;
    cin >> v >> u;
    --v, u--;
    if (v == u) {
      id[v] = 1;
      continue;
    }
    adj[v].push_back(u);
    adj[u].push_back(v);
  }
}
pair<int, int> dfs(int v) {
  mark[v] = 1;
  pair<int, int> res = make_pair(1, ((int)adj[v].size() % 2 == 1 ? 1 : 0));
  for (int i(0); i < int(adj[v].size()); i++) {
    int u = adj[v][i];
    if (mark[u]) continue;
    pair<int, int> sum = dfs(u);
    res = make_pair(res.first + sum.first, res.second + sum.second);
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  readInput();
  for (int i(0); i < int(n); i++)
    if (!mark[i]) {
      pair<int, int> res = dfs(i);
      if (res.first > 1 || id[i] || i == 0) seq.push_back(res.second);
    }
  sort(seq.begin(), seq.end());
  while (seq.size() > 1) {
    int res = seq.back();
    seq.pop_back();
    int ret = seq.back();
    seq.pop_back();
    if (res > 0 && ret > 0)
      seq.push_back(res + ret - 2);
    else if (res > 0 && ret == 0)
      seq.push_back(res);
    else
      seq.push_back(2);
    ++ans;
  }
  cout << ans + seq.back() / 2 << endl;
  return 0;
}
