#include <bits/stdc++.h>
using namespace std;
int m, n, j, k, l, i, o, p, __t, Deg[1020000], Ans, Odd[1020000], S[1020000],
    Visit[1020000];
char ch;
void read(int &a) {
  for (ch = getchar(); (ch < '0' || ch > '9') && (ch != '-'); ch = getchar())
    ;
  if (ch == '-')
    a = 0, __t = -1;
  else
    a = ch - '0', __t = 1;
  for (ch = getchar(); ch >= '0' && ch <= '9'; ch = getchar())
    a = a * 10 + ch - '0';
  a *= __t;
}
struct MergerSet {
  int F[1020000];
  MergerSet() {
    for (int i = (1); i <= (1020000 - 1); i++) F[i] = i;
  }
  int G(int P) {
    int i = P;
    for (; P != F[P]; P = F[P])
      ;
    for (int j = F[i]; i != P; i = j, j = F[i]) F[i] = P;
    return P;
  }
  void Merger(int a, int b) {
    if (G(a) == G(b)) return;
    if (G(a) < G(b)) swap(a, b);
    F[G(a)] = G(b);
  }
} ms;
vector<int> N;
int main() {
  read(m), read(n);
  for (int i = (1); i <= (n); i++) {
    read(j), read(k);
    ms.Merger(j, k);
    Deg[j] ^= 1;
    Deg[k] ^= 1;
    Visit[j] = Visit[k] = 1;
  }
  for (int i = (1); i <= (m); i++) Odd[ms.G(i)] += Deg[i], S[ms.G(i)]++;
  int Now = Odd[1];
  for (int i = (2); i <= (m); i++)
    if (ms.G(i) == i && Visit[i]) N.push_back(Odd[i]);
  sort(N.begin(), N.end());
  bool Link = 0;
  for (int i = ((N.size()) - 1); i >= (0); i--) {
    if (Now == 0) {
      Now = 1 + ((N[i] == 0) ? (1) : (N[i] - 1));
      Ans++;
    } else {
      Now += ((N[i] == 0) ? (1) : (N[i] - 1)) - 1;
      Ans++;
    }
  }
  printf("%d\n", Ans + Now / 2);
}
