#include <bits/stdc++.h>
void Get(int &T) {
  char C;
  bool F = 0;
  for (; C = getchar(), C < '0' || C > '9';)
    if (C == '-') F = 1;
  for (T = C - '0'; C = getchar(), C >= '0' && C <= '9'; T = T * 10 + C - '0')
    ;
  F && (T = -T);
}
int N, M;
struct E {
  int V, Next;
} Edge[2000005];
int EdgeTop;
int Head[2000005];
void Add(int U, int V) {
  Edge[++EdgeTop] = (E){V, Head[U]};
  Head[U] = EdgeTop;
}
int D[1000005];
void Init() {
  Get(N);
  Get(M);
  for (int i = 1, U, V; i <= M; i++) {
    Get(U);
    Get(V);
    Add(U, V);
    Add(V, U);
    D[U]++;
    D[V]++;
  }
}
int Visited[1000005];
int Stacki[1000005];
int StackX[1000005];
int Cnt;
void DFS(int X) {
  int Top = 1, i;
  StackX[Top] = X;
Call:
  X = StackX[Top];
  Cnt += (D[X] & 1);
  Visited[X] = 1;
  for (i = Head[X]; i; i = Edge[i].Next)
    if (!Visited[Edge[i].V]) {
      StackX[Top + 1] = Edge[i].V;
      Stacki[Top] = i;
      Top++;
      goto Call;
    Return:
      Top--;
      X = StackX[Top];
      i = Stacki[Top];
    }
  if (Top >= 2) goto Return;
}
int Ans;
void Work() {
  int Sum = 0;
  bool Added = 0;
  for (int i = 1; i <= N; i++)
    if (!Visited[i]) {
      Cnt = 0;
      DFS(i);
      Ans += Cnt;
      if (D[i] != 0 || i == 1) {
        Sum++;
        if (Cnt == 0) {
          Added = 1;
          Ans += 2;
        }
      }
    }
  if (Sum == 1 && Added == 1) Ans -= 2;
  Ans >>= 1;
}
void Output() { printf("%d\n", Ans); }
int main() {
  Init();
  Work();
  Output();
  return 0;
}
