#include <bits/stdc++.h>
using namespace std;
int cnt[110], a[110][110];
vector<int> v;
int main() {
  int i, j, k, l, n, m, flag = 0, ans = 0;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n + 1; i++) {
    cnt[i] = 0;
    for (j = 1; j <= n + 1; j++) a[i][j] = 0;
  }
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &k, &l);
    a[k][l] = a[l][k] = 1;
    cnt[l] += 1;
    cnt[k] += 1;
  }
  while (1) {
    flag = 1;
    v.clear();
    for (i = 1; i <= n; i++) {
      if (cnt[i] == 1) {
        flag = 0;
        for (j = 1; j <= n; j++) {
          if (a[i][j]) {
            a[i][j] = a[j][i] = 0;
            cnt[i] -= 1;
            v.push_back(j);
          }
        }
      }
    }
    for (i = 0; i < v.size(); i++) cnt[v[i]]--;
    if (flag)
      break;
    else
      ans++;
  }
  printf("%d\n", ans);
  return 0;
}
