#include <bits/stdc++.h>
using namespace std;
int a[15000], b[15000], deg[15000];
bool visited[15000];
int main() {
  int n, m;
  cin >> n >> m;
  int cnt = 0;
  for (int i = 1; i <= m; i++) {
    int p, q;
    cin >> p >> q;
    a[i] = p, b[i] = q;
  }
  while (1) {
    memset(deg, 0, sizeof(deg));
    for (int i = 1; i <= m; i++) {
      if (visited[a[i]]) continue;
      if (visited[b[i]]) continue;
      deg[a[i]]++;
      deg[b[i]]++;
    }
    bool ok = false;
    for (int i = 1; i <= n; i++) {
      if (deg[i] == 1) ok = true, visited[i] = 1;
    }
    if (!ok) break;
    cnt++;
  }
  cout << cnt;
  return 0;
}
