#include <bits/stdc++.h>
using namespace std;
bool v[101][101];
void solve() {
  long long n, m;
  cin >> n >> m;
  long long x, y;
  map<long long, long long> mp;
  for (long long i = 0; i < m; i++) {
    cin >> x >> y;
    mp[x]++;
    mp[y]++;
    v[x][y] = 1;
    v[y][x] = 1;
  }
  long long C;
  long long ans = 0;
  do {
    long long E[101];
    C = 0;
    for (long long i = 1; i <= n; i++) {
      if (mp[i] == 1) {
        E[C++] = i;
        mp[i]--;
      }
    }
    for (long long i = 0; i < C; i++) {
      for (long long j = 1; j <= n; j++) {
        if (v[E[i]][j]) mp[j]--;
      }
    }
    ans++;
  } while (C > 0);
  cout << ans - 1 << endl;
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
