#include <bits/stdc++.h>

using namespace std;

vector<int>g[51];
int n,m;
int x[51];
int main() {
  cin >> n >> m;

  for(int i = 0; i < m; i++) {
    int a,b;
    cin >> a >> b;
    a--; b--;
    g[a].push_back(b);
    g[b].push_back(a);
    x[a]++;
    x[b]++;
  }
  int ans = 0;

  bool ok = true;

  while(ok) {
    ok = false;
    for(int i = 0; i < n; i++) {
      if(x[i] == 1) {
	x[i]--;
	for(int j = 0;  j < g[i].size(); j++) {
	  int u = g[i][j];
	  x[u]--;
	}
	ok = true;
	ans++;
      }
    }
  }

  cout << ans << endl;
}
    
