#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<set<int>> v(n + 1);
  int groups = 0;
  int a, b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    v[a].insert(b);
    v[b].insert(a);
  }
  while (1) {
    vector<int> v1;
    for (int i = 1; i <= n; i++) {
      if (v[i].size() == 1) {
        v1.push_back(i);
      }
    }
    for (int i = 0; i < v1.size(); i++) {
      auto itr = v[v1[i]].begin();
      auto x = *itr;
      v[v1[i]].clear();
      v[x].erase(v1[i]);
    }
    if (v1.size())
      groups++;
    else
      break;
  }
  cout << groups << "\n";
  return 0;
}
