#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m, i, u, v, flag, ans = 0;
  cin >> n >> m;
  set<long long> adj[n + 1];
  for (i = 0; i < m; i++) {
    cin >> u >> v;
    adj[u].insert(v);
    adj[v].insert(u);
  }
  do {
    flag = 0;
    long long s[n + 1];
    for (i = 1; i <= n; i++) {
      if (adj[i].size() == 1) flag = 1;
      s[i] = adj[i].size();
    }
    for (i = 1; i <= n; i++)
      if (s[i] == 1) adj[*adj[i].begin()].erase(i), adj[i].clear();
    if (flag) ans++;
  } while (flag);
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
}
