#include <bits/stdc++.h>
using namespace std;
int xDir[8] = {0, 0, -1, 1, 1, -1, -1, 1};
int yDir[8] = {1, -1, 0, 0, 1, -1, 1, -1};
int EPS = 1e-10;
int dComp(double d1, double d2) {
  if (abs(d1 - d2) <= EPS) return 0;
  if (d1 > d2)
    return 1;
  else
    return -1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, x, y;
  cin >> n >> m;
  vector<set<int> > tie(n + 1);
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    tie[x].insert(y);
    tie[y].insert(x);
  }
  int groups = 0;
  while (1) {
    vector<int> vec;
    for (int i = 1; i <= n; i++) {
      if (tie[i].size() == 1) vec.push_back(i);
    }
    for (int i = 0; i < vec.size(); i++) {
      set<int>::iterator st = tie[vec[i]].begin();
      tie[vec[i]].clear();
      tie[*st].erase(vec[i]);
    }
    if (vec.size())
      groups++;
    else
      break;
  }
  cout << groups << endl;
  return 0;
}
