#include <bits/stdc++.h>
using namespace std;
int main() {
  map<long long int, long long int> ma;
  map<long long int, long long int>::iterator itr;
  long long int n, m, i, a[50000], b[50000], c = 10, d = 0;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
    ma[a[i]]++;
    ma[b[i]]++;
  }
  while (c > 0) {
    c = 0;
    for (itr = ma.begin(); itr != ma.end(); itr++) {
      if (itr->second == 1) {
        c++;
        (itr->second)--;
      }
    }
    if (c > 0) {
      for (i = 0; i < m; i++) {
        if (ma[a[i]] == 0 && ma[b[i]] > 0) {
          ma[b[i]]--;
          ma[a[i]]--;
        }
        if (ma[b[i]] == 0 && ma[a[i]] > 0) {
          ma[a[i]]--;
          ma[b[i]]--;
        }
      }
      d++;
    }
  }
  cout << d;
}
