#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> v(n + 1);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  int ans = 0;
  while (1) {
    vector<vector<int>> ones;
    vector<int> idx;
    for (int i = 1; i <= v.size(); i++) {
      if (v[i].size() == 1) {
        ones.push_back(v[i]);
        idx.push_back(i);
      }
    }
    if (ones.size() == 0) break;
    for (int c = 0; c < ones.size(); c++) {
      int element = ones[c][0];
      v[idx[c]].erase(remove(v[idx[c]].begin(), v[idx[c]].end(), element),
                      v[idx[c]].end());
      v[element].erase(remove(v[element].begin(), v[element].end(), idx[c]),
                       v[element].end());
      if (c == ones.size() - 1) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
