#include <bits/stdc++.h>
using namespace std;
map<int, int> cnt;
map<int, vector<int> > numbers;
int main() {
  ios::sync_with_stdio(0);
  int n, m, t1, t2;
  cin >> n >> m;
  for (long long i = 0; i < m; ++i) {
    cin >> t1 >> t2;
    ++cnt[t1], ++cnt[t2];
    numbers[t1].push_back(t2);
    numbers[t2].push_back(t1);
  }
  int groups = 0;
  while (1) {
    bool found = 0;
    vector<int> tormv;
    int s = 0;
    for (long long i = 1; i < n + 1; ++i) {
      if (cnt[i] == 1) {
        found = 1;
        tormv.push_back(i);
        ++s;
      }
    }
    for (long long j = 0; j < s; ++j) {
      int i = tormv[j];
      cnt[i] = 0;
      vector<int>::iterator it = numbers[i].begin();
      for (; it != numbers[i].end(); ++it) {
        int t = *it;
        --cnt[t];
      }
    }
    if (found)
      ++groups;
    else
      break;
  }
  cout << groups;
  return 0;
}
