#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l;
  cin >> n >> l;
  vector<set<int>> value(n + 1);
  int temp, temp1;
  for (int i = 0; i < l; i++) {
    cin >> temp >> temp1;
    value[temp].insert(temp1);
    value[temp1].insert(temp);
  }
  int groups = 0;
  while (1) {
    vector<int> size1;
    for (int i = 1; i <= n; i++) {
      if (value[i].size() == 1) {
        size1.push_back(i);
      }
    }
    for (int j = 0; j < (int)size1.size(); j++) {
      set<int>::iterator it = value[size1[j]].begin();
      value[size1[j]].clear();
      value[*it].erase(size1[j]);
    }
    if (size1.size())
      groups++;
    else {
      break;
    }
  }
  cout << groups;
}
