#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> adj[n + 1];
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  int ans = 0;
  while (1) {
    int num = 0;
    vector<int> temp;
    for (int i = 1; i <= n; i++) {
      if (adj[i].size() == 1) {
        num++;
        temp.push_back(i);
      }
    }
    if (num > 0) {
      ans++;
      for (int i = 0; i < num; i++) {
        int nebr = adj[temp[i]][0];
        adj[temp[i]].clear();
        adj[nebr].erase(remove(adj[nebr].begin(), adj[nebr].end(), temp[i]),
                        adj[nebr].end());
      }
    } else
      break;
  }
  cout << ans;
}
