#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, t, m, i, j = 0, k = 0, l, x, y, z, f;
  long long a[100005], b[100005];
  vector<long long> v, vip, cp[100005];
  map<long long, long long> mp;
  cin >> n >> m;
  for (i = 0; i < m; i++)
    cin >> a[i] >> b[i], mp[a[i]]++, mp[b[i]]++, cp[a[i]].push_back(b[i]),
        cp[b[i]].push_back(a[i]);
  f = 1;
  while (f) {
    f = 0;
    std::vector<long long> v;
    for (i = 1; i < n + 1; i++)
      if (mp[i] == 1) {
        f = 1;
        mp[i]--;
        for (auto x : cp[i])
          if (mp[x] == 1)
            mp[x--];
          else
            v.push_back(x);
      }
    for (i = 0; i < v.size(); i++) mp[v[i]]--;
    if (f) k++;
  }
  cout << k << endl;
}
int main() { solve(); }
