#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  unordered_map<int, int> mp;
  vector<int> v[n + 1];
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  vector<int> t;
  int ans = 0;
  while (1) {
    int num = 0;
    vector<int> t;
    for (int i = 1; i <= n; i++) {
      if (v[i].size() == 1) {
        num++;
        t.push_back(i);
      }
    }
    if (num > 0) {
      ans++;
      for (int i = 0; i < num; i++) {
        int neigh = v[t[i]][0];
        v[t[i]].clear();
        v[neigh].erase(remove(v[neigh].begin(), v[neigh].end(), t[i]),
                       v[neigh].end());
      }
    } else {
      break;
    }
  }
  cout << ans << endl;
}
