#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<set<int>> g(n);
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    g[x].insert(y);
    g[y].insert(x);
  }
  int flag = 1;
  int ans = 0;
  while (flag == 1) {
    flag = 0;
    vector<int> temp;
    for (int i = 0; i < n; i++) {
      if (g[i].size() == 1) {
        temp.push_back(i);
        flag = 1;
      }
    }
    for (int i = 0; i < temp.size(); i++) {
      int x = temp[i];
      auto it = g[x].begin();
      g[*it].erase(x);
      g[x].clear();
    }
    if (flag == 1) ans++;
  }
  cout << ans << endl;
}
signed main() {
  solve();
  return 0;
}
