#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
long long power(long long a, long long b, long long m = MOD) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) ans = ((ans % m) * (a % m)) % m;
    a = ((a % m) * (a % m)) % m;
    b >>= 1;
  }
  return ans;
}
long long dir[] = {-1, 0, 1, 0, -1};
long long dx[8] = {0, 0, 1, -1, 1, -1, 1, -1};
long long dy[8] = {1, -1, 0, 0, 1, 1, -1, -1};
void solve() {
  long long n, m;
  cin >> n >> m;
  ;
  vector<long long> g[n];
  vector<long long> deg(n, 0);
  for (long long j = 0; j < m; j++) {
    long long u, v;
    cin >> u >> v;
    ;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
    deg[u]++;
    deg[v]++;
  }
  long long ans = 0;
  while (true) {
    vector<long long> remove;
    for (long long i = 0; i < n; i++) {
      if (deg[i] == 1) remove.push_back(i);
    }
    if (!(long long)(remove).size()) break;
    for (auto u : remove) {
      deg[u]--;
      for (auto v : g[u]) deg[v]--;
    }
    ans++;
  }
  cout << ans << " ";
  ;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
}
