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