#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> v;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back({x, y});
  }
  int cntr = 0;
  while (true) {
    map<int, int> mp;
    map<int, bool> mp2;
    for (int i = 0; i < v.size(); i++) {
      mp[v[i].first]++;
      mp[v[i].second]++;
    }
    bool flag = false;
    for (auto it : mp) {
      if (it.second == 1) flag = true, mp2[it.first] = true;
    }
    if (flag == false)
      break;
    else {
      cntr++;
      int sz = v.size();
      for (int i = 0; i < v.size(); i++) {
        if (mp2[v[i].first] == true || mp2[v[i].second] == true) {
          if (i == 0)
            v.erase(v.begin());
          else
            v.erase(v.begin() + i);
          i--;
        }
      }
    }
  }
  cout << cntr;
  return 0;
}
