#include <bits/stdc++.h>
using namespace std;
int GetNumber() {
  char c;
  while (c = getchar(), c < '0' || c > '9')
    ;
  int X = c - 48;
  while (c = getchar(), c >= '0' && c <= '9') X = X * 10 + c - 48;
  return X;
}
int P[1000000];
int Root(int X) { return (P[X] == X) ? X : (P[X] = Root(P[X])); }
int main() {
  int N = GetNumber(), M = GetNumber();
  for (int i = 0; i < N; i++) P[i] = i;
  static int Degree[1000000];
  memset(Degree, 0, sizeof(Degree));
  static bool Cycle[1000000];
  memset(Cycle, 0, sizeof(Cycle));
  for (int i = 0; i < M; i++) {
    int X = GetNumber() - 1;
    int Y = GetNumber() - 1;
    P[Root(X)] = Root(Y);
    Degree[X]++;
    Degree[Y]++;
    if (X == Y) Cycle[X] = true;
  }
  static int Size[1000000];
  memset(Size, 0, sizeof(Size));
  for (int i = 0; i < N; i++) Size[Root(i)]++;
  static int Count[1000000];
  memset(Count, 0, sizeof(Count));
  for (int i = 0; i < N; i++)
    if (Degree[i] & 1) Count[Root(i)]++;
  int Ans = 0, Sum = 0, Total = 0;
  for (int i = 0; i < N; i++)
    if (Size[i]) {
      if (Size[i] == 1 && i && !Cycle[i]) continue;
      Total++;
      Sum += Count[i];
      Ans += Count[i] ? Count[i] : 2;
    }
  if (Total == 1)
    printf("%d\n", Sum / 2);
  else
    printf("%d\n", Ans / 2);
  return 0;
}
