#include <bits/stdc++.h>
using namespace std;
int data[100 + 10];
vector<pair<int, int> > all;
long long a;
int main() {
  memset(data, 0, sizeof(data));
  all.clear();
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int t1, t2;
    cin >> t1 >> t2;
    all.push_back(make_pair(t1, t2));
    data[t1]++;
    data[t2]++;
  }
  int ans = 0;
  bool sw = true;
  for (int i = 0; sw; i++) {
    bool sw2 = false;
    vector<int> epack;
    epack.clear();
    for (int j = 1; j <= n; j++) {
      if (data[j] != 1) continue;
      for (int k = 0; k < all.size(); k++) {
        if (all[k].first == j) {
          epack.push_back(j);
          epack.push_back(all[k].second);
          sw2 = true;
        } else if (all[k].second == j) {
          epack.push_back(j);
          epack.push_back(all[k].first);
          sw2 = true;
        }
      }
    }
    for (int p = 0; p < epack.size(); p++) {
      data[epack[p]]--;
    }
    epack.clear();
    if (sw2) ans++;
    sw = sw2;
  }
  cout << ans << endl;
  return 0;
}
