#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b;
  scanf("%d %d", &n, &m);
  vector<set<int> > x(n + 1);
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &a, &b);
    x[a].insert(b);
    x[b].insert(a);
  }
  vector<int> v;
  int ans = 0;
  while (2) {
    v.clear();
    for (int i = 0; i <= n; i++) {
      if (x[i].size() == 1) v.push_back(i);
    }
    for (int i = 0; i < v.size(); i++) {
      set<int>::iterator it = x[v[i]].begin();
      x[v[i]].clear();
      x[*it].erase(v[i]);
    }
    if (v.size())
      ans++;
    else
      break;
  }
  printf("%d", ans);
  return 0;
}
