#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  int n, k;
  cin >> n >> k;
  vector<pair<int, int> > v(k);
  for (int i = 0; i < k; i++) cin >> v[i].first >> v[i].second;
  bool ok = 0;
  vector<bool> rem(n, false);
  int res = -1;
  while (ok == 0) {
    ok = 1;
    vector<int> cnt(n, 0);
    for (int i = 0; i < k; i++) {
      if (!rem[v[i].first - 1] && !rem[v[i].second - 1]) {
        cnt[v[i].first - 1]++;
        cnt[v[i].second - 1]++;
      }
    }
    for (int i = 0; i < n; i++)
      if (cnt[i] == 1) {
        rem[i] = 1;
        ok = 0;
      }
    res++;
  }
  cout << res;
  return 0;
}
