#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, MOD = 1e9 + 7;
int i, a, b, c, d, ans;
vector<int> v[N];
int main() {
  cin >> a >> b;
  while (b--) {
    cin >> c >> d;
    v[c].push_back(d);
    v[d].push_back(c);
  }
  int sum = 1;
  vector<int> an;
  while (sum) {
    sum = 0;
    for (i = 1; i <= a; i++) {
      if (v[i].size() == 1) an.push_back(i);
    }
    for (int x : an) {
      int num = v[x][0];
      v[x].clear();
      auto it = find(v[num].begin(), v[num].end(), x);
      if (it != v[num].end()) v[num].erase(it);
    }
    sum = an.size();
    if (sum) ans++;
    an.clear();
  }
  cout << ans;
  return 0;
}
