#include <bits/stdc++.h>
using namespace std;
pair<int, int> arr[10009];
bool out[109];
int T[109];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++)
    cin >> arr[i].first >> arr[i].second, arr[i].first--, arr[i].second--;
  int res = 0;
  while (1) {
    memset(T, 0, sizeof(T));
    for (int i = 0; i < m; i++)
      if (!out[arr[i].first] && !out[arr[i].second])
        T[arr[i].first]++, T[arr[i].second]++;
    bool c = 0;
    for (int i = 0; i < n; i++)
      if (T[i] == 1) {
        c = 1;
        out[i] = 1;
      }
    if (!c) break;
    res++;
  }
  cout << res << endl;
  return 0;
}
