#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 1;
  while (t--) {
    long long int n, m, c = 0;
    cin >> n >> m;
    vector<set<long long int>> v(n + 1);
    long long int x, y;
    for (int i = 0; i < m; i++) {
      cin >> x >> y;
      v[x].insert(y);
      v[y].insert(x);
    }
    while (1) {
      vector<long long int> q;
      for (int i = 1; i <= n; i++)
        if (v[i].size() == 1) q.push_back(i);
      for (int i = 0; i < q.size(); i++) {
        auto it = v[q[i]].begin();
        v[q[i]].clear();
        v[*it].erase(q[i]);
      }
      if (q.size() > 0)
        c++;
      else
        break;
    }
    cout << c;
  }
  return 0;
}
