#include <bits/stdc++.h>
using namespace std;
int degree[100005];
queue<pair<int, int> > leaves;
vector<int> road[100005];
bool del[100005];
int n, m;
int ans;
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    road[x].push_back(y);
    road[y].push_back(x);
    degree[x]++;
    degree[y]++;
  }
  for (int i = 1; i <= n; i++) {
    if (degree[i] == 1) leaves.push(pair<int, int>(i, 1));
  }
  while (leaves.size()) {
    int x = leaves.front().first;
    if (degree[x] != 1) {
      leaves.pop();
      continue;
    }
    ans = leaves.front().second;
    leaves.pop();
    for (int i = 0; i < road[x].size(); i++) {
      degree[road[x][i]]--;
      if (degree[road[x][i]] == 1) {
        leaves.push(pair<int, int>(road[x][i], ans + 1));
      }
    }
  }
  cout << ans;
}
