#include <bits/stdc++.h>
using namespace std;
const long long mod = 1073741824;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  map<int, set<int>> mp;
  for (int x = 0; x < m; x++) {
    int a, b;
    cin >> a >> b;
    mp[a].insert(b);
    mp[b].insert(a);
  }
  int ans = 0;
  int cpy = n;
  while (cpy--) {
    vector<pair<int, int>> v;
    for (int x = 1; x <= n; x++) {
      if (mp[x].size() == 1) {
        v.emplace_back(x, *mp[x].begin());
        mp[x].clear();
      }
    }
    if (!v.empty()) ans++;
    for (int x = 0; x < v.size(); x++) {
      mp[v[x].second].erase(v[x].first);
    }
  }
  cout << ans;
  return 0;
}
