#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<int> v[n + 1];
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  vector<int> temp;
  int ans = 0;
  while (true) {
    int t = 0;
    for (int i = 1; i <= n; i++) {
      if (v[i].size() == 1) {
        temp.push_back(i);
        t++;
      }
    }
    if (t == 0) {
      break;
    }
    ans++;
    for (int i = 0; i < t; i++) {
      int var = temp[i];
      for (auto itr : v[var]) {
        auto pos = find(v[itr].begin(), v[itr].end(), var);
        if (pos != v[itr].end()) {
          v[itr].erase(pos);
        }
      }
      v[var].clear();
    }
    temp.clear();
  }
  cout << ans << endl;
  return 0;
}
