#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int> > e(n, vector<int>(n, 0));
  vector<int> deg(n, 0);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    e[a][b] = e[b][a] = 1;
    deg[a]++;
    deg[b]++;
  }
  int time = 0;
  while (true) {
    bool found = false;
    vector<int> kill;
    for (int i = 0; i < n; i++) {
      if (deg[i] == 1) {
        found = true;
        kill.push_back(i);
      }
    }
    while (!kill.empty()) {
      int i = kill.back();
      kill.pop_back();
      for (int j = 0; j < n; j++)
        if (e[i][j] == 1) {
          deg[j]--;
          deg[i]--;
          e[i][j] = e[j][i] = 0;
        }
    }
    if (!found)
      break;
    else
      time++;
  }
  cout << time << endl;
}
