#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[101][101];
int cnt = 0;
int main() {
  cin >> n >> m;
  int tmpa, tmpb;
  for (int i = 0; i < m; i++) {
    cin >> tmpa >> tmpb;
    a[tmpa - 1][tmpb - 1] = 1;
    a[tmpb - 1][tmpa - 1] = 1;
  }
  bool flag = true;
  while (flag) {
    flag = false;
    vector<int> temp;
    for (int i = 0; i < n; i++) {
      int sum = 0;
      for (int j = 0; j < n; j++) {
        if (a[i][j]) sum++;
      }
      if (sum == 1) {
        temp.push_back(i);
      }
    }
    flag = (temp.size() > 0);
    if (flag) cnt++;
    for (int s = 0; s < temp.size(); s++) {
      for (int k = 0; k < n; k++) {
        a[temp[s]][k] = 0;
        a[k][temp[s]] = 0;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
