#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, m;
  cin >> n >> m;
  vector<long long int> a(n + 1);
  vector<long long int> adj[n + 1];
  while (m--) {
    long long int x, y;
    cin >> x >> y;
    a[x]++;
    a[y]++;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  queue<long long int> q;
  long long int ans = 0;
  while (true) {
    for (long long int i = 1; i <= n; i++) {
      if (a[i] == 1) {
        q.push(i);
        a[i]--;
      }
    }
    if (q.empty()) break;
    while (!q.empty()) {
      long long int m = q.front();
      q.pop();
      for (auto it : adj[m]) a[it]--;
    }
    ans++;
  }
  cout << ans << endl;
}
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  c_p_c();
  solve();
  return 0;
}
