#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> adj(n);
  int x, y;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    x = x - 1;
    y = y - 1;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  int res = 0;
  while (true) {
    int temp = 0;
    vector<vector<int>> adjtemp = adj;
    for (int i = 0; i < n; i++) {
      if (adj[i].size() == 1) {
        temp = 1;
        int y = adj[i][0];
        if (adjtemp[i].size() > 0) adjtemp[i].erase(adjtemp[i].begin());
        for (int j = 0; j < adjtemp[y].size(); j++) {
          if (adjtemp[y][j] == i) adjtemp[y].erase(adjtemp[y].begin() + j);
        }
      }
    }
    adj = adjtemp;
    if (temp == 1)
      res++;
    else
      break;
  }
  cout << res << endl;
}
