#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, t1, t2;
  cin >> n >> m;
  vector<vector<int> > a(n + 1);
  int A[n + 1], B[n + 1];
  for (i = 0; i <= n; i++) {
    A[i] = 0;
    B[i] = 0;
  }
  for (i = 0; i < m; i++) {
    cin >> t1 >> t2;
    a[t1].push_back(t2);
    a[t2].push_back(t1);
    A[t1]++;
    A[t2]++;
  }
  int steps = 0;
  while (1) {
    int count = 0;
    for (i = 0; i < n + 1; i++) {
      B[i] = 0;
    }
    for (i = 1; i <= n; i++) {
      if (A[i] == 1) {
        count++;
        B[i] = 1;
        for (j = 0; j < a[i].size(); j++) {
          B[a[i][j]]++;
        }
      }
    }
    for (i = 1; i <= n; i++) {
      A[i] -= B[i];
    }
    if (count == 0) {
      cout << steps;
      return 0;
    }
    steps++;
  }
  return 0;
}
