#include <bits/stdc++.h>
using namespace std;
void read(int& x) { scanf("%d", &x); }
template <typename T, typename... Args>
void read(T& a, Args&... b) {
  read(a);
  read(b...);
}
int n, m;
vector<pair<int, int> > edge;
set<int> ee[100001];
int deg[100001];
bool enq[100001];
queue<int> q;
bool color[100001];
void doTree() {
  for (auto tmp : edge) {
    int a, b;
    tie(a, b) = tmp;
    ++deg[a];
    ++deg[b];
    ee[a].insert(b);
    ee[b].insert(a);
  }
  for (int i = 1; i <= n; ++i) {
    if (deg[i] == 1) {
      enq[i] = true;
      q.push(i);
    }
  }
  int ans = 0;
  while (q.size()) {
    int x = q.front();
    q.pop();
    int y = *ee[x].begin();
    ee[x].clear();
    --deg[x];
    --deg[y];
    ee[y].erase(x);
    if (!enq[y] && deg[y] == 1) {
      enq[y] = true;
      q.push(y);
    }
    if (!color[x]) {
      color[x] ^= 1;
      color[y] ^= 1;
      ++ans;
    }
  }
  printf("%d\n", ans);
}
int main() {
  read(n, m);
  for (int i = 1; i <= m; ++i) {
    int a, b;
    read(a, b);
    edge.push_back({a, b});
  }
  if (m == n - 1) doTree();
  return 0;
}
