#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N, M;
  cin >> N >> M;
  vector<vector<long long>> G(N, vector<long long>(N));
  vector<long long> deg(N);
  for (long long i = 0; i < M; i++) {
    long long a, b;
    cin >> a >> b;
    a--;
    b--;
    G[a][b] = G[b][a] = 1;
    deg[a]++;
    deg[b]++;
  }
  queue<long long> Q;
  for (long long i = 0; i < N; i++)
    if (deg[i] == 1) {
      Q.push(i);
    }
  long long ans = 0;
  while (!Q.empty()) {
    ans++;
    long long sz = Q.size();
    while (sz--) {
      long long v = Q.front();
      Q.pop();
      for (long long u = 0; u < N; u++)
        if (G[v][u]) {
          G[v][u] = G[u][v] = 0;
          deg[v]--;
          deg[u]--;
        }
    }
    for (long long i = 0; i < N; i++)
      if (deg[i] == 1) {
        Q.push(i);
      }
  }
  cout << ans << endl;
  return 0;
}
