#include <bits/stdc++.h>
using namespace std;
vector<int> v[101];
int a[101];
int main() {
  int n, k = 0, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
    a[x]++;
    a[y]++;
  }
  for (int i = 0; i < n; i++) {
    vector<int> w;
    for (int j = 1; j <= n; j++)
      if (a[j] == 1) w.push_back(j);
    if (w.size()) k++;
    for (int j = 0; j < w.size(); j++) {
      a[w[j]]--;
      for (int h = 0; h < v[w[j]].size(); h++) a[v[w[j]][h]]--;
    }
  }
  cout << k << endl;
  return 0;
}
