#include <bits/stdc++.h>
using namespace std;
void mikrae_s() {
  int n, l, c = 1, r = 0, a, b, i;
  cin >> n >> l;
  std::vector<int> v;
  map<int, int> m;
  for (long long int i = 0; i < l; i++) {
    cin >> a >> b;
    v.push_back(a);
    m[a]++;
    v.push_back(b);
    m[b]++;
  }
  while (c) {
    c = 0;
    std::vector<int> f;
    for (auto x = m.begin(); x != m.end(); x++) {
      if (x->second == 1) {
        c = 1;
        i = find(v.begin(), v.end(), x->first) - v.begin();
        if (i % 2 == 0) {
          f.push_back(v[i + 1]);
          v[i + 1] = 0;
          v[i] = 0;
        } else {
          f.push_back(v[i - 1]);
          v[i - 1] = 0;
          v[i] = 0;
        }
        x->second = 0;
      }
    }
    for (auto y : f) {
      m[y]--;
    }
    r++;
  }
  r--;
  cout << r;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int TEST = 1;
  while (TEST--) mikrae_s();
  return 0;
}
