#include <bits/stdc++.h>
using namespace std;
int f[1000001], d[1000001], p[1000001], vis[1000001];
int n, m, ans = 0, tmp = 0, flag = 0, sum = 0;
int getfa(int x) { return (!f[x]) ? x : (f[x] = getfa(f[x])); }
int main() {
  int x, y;
  d[1] = 2;
  scanf("%d %d", &n, &m);
  if (m == 0)
    printf("0\n");
  else {
    for (int i = 1; i <= m; i++) {
      scanf("%d %d", &x, &y);
      if (x == 1 && y == 1) flag++;
      ++d[x], ++d[y];
      int tmpx = getfa(x), tmpy = getfa(y);
      if (tmpx != tmpy) f[tmpx] = tmpy;
      vis[x] = 1, vis[y] = 1;
    }
    for (int i = 1; i <= n; i++)
      if (!vis[i]) ++sum;
    if (m == flag)
      printf("0\n");
    else {
      for (int i = 1; i <= n; i++)
        if (!f[i]) ++tmp;
      for (int i = 1; i <= n; i++)
        if (d[i] & 1) tmp = 0;
      if (tmp == 1)
        printf("0\n");
      else {
        for (int i = 1; i <= n; i++)
          if (d[i] & 1) p[getfa(i)] |= 1, ans++;
        for (int i = 1; i <= n; i++)
          if (!f[i] && !p[i] && d[i]) ans += 2;
        if (n == 3 && sum == 1 && vis[1])
          printf("%d\n", (ans / 2) - 1);
        else
          printf("%d\n", (ans / 2));
      }
    }
  }
  return 0;
}
