#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m, i, j;
  cin >> n >> m;
  int x, y;
  vector<vector<int> > adj(n);
  vector<int> ncon(n, 0);
  for (i = (0); i < (m); i++) {
    cin >> x >> y;
    adj[x - 1].push_back(y - 1);
    adj[y - 1].push_back(x - 1);
    ncon[x - 1]++;
    ncon[y - 1]++;
  }
  vector<int> onecon;
  for (i = (0); i < (n); i++)
    if (ncon[i] == 1) onecon.push_back(i);
  int maxd = 0;
  queue<int> q;
  vector<int> dist(n, 0), rem(n, 0);
  for (auto i : onecon) {
    q.push(i);
    dist[i] = 1;
  }
  if ((int)((onecon).size()) != 0) maxd = 1;
  while (!q.empty()) {
    int cur = q.front();
    q.pop();
    rem[cur] = 1;
    if (ncon[cur] == 1) maxd = max(maxd, dist[cur]);
    for (auto next : adj[cur]) {
      if (rem[next] == 1) continue;
      ncon[next]--;
      if (ncon[next] == 1) {
        dist[next] = dist[cur] + 1;
        q.push(next);
      }
    }
  }
  cout << maxd << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
