#include <bits/stdc++.h>
using namespace std;
int a[11111], b[11111];
struct node {
  int l, r;
} q[11111];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> q[i].l >> q[i].r;
    a[q[i].l]++;
    a[q[i].r]++;
  }
  int sum = 0;
  while (1) {
    int k = 0, flag = 0;
    for (int i = 1; i <= m; i++) {
      if (a[q[i].l] == 1 || a[q[i].r] == 1) {
        b[++k] = q[i].l;
        b[++k] = q[i].r;
        flag = 1;
      }
    }
    if (flag == 0) {
      break;
    }
    sum++;
    for (int i = 1; i <= k; i++) {
      a[b[i]]--;
    }
  }
  cout << sum << endl;
  return 0;
}
