#include <bits/stdc++.h>
int n, m, pos, deg[110], mat[110][110], stack[110] = {-1};
void find() {
  int i;
  pos = 0;
  for (i = 1; i <= n; i++)
    if (deg[i] == 1) {
      stack[pos++] = i;
    }
  return;
}
void update() {
  int i, j, k;
  for (k = 0; k < pos; k++) {
    i = stack[k];
    deg[i] = 0;
    for (j = 1; j <= n; j++)
      if (mat[i][j] == 1) {
        deg[j]--;
        mat[i][j] = mat[j][i] = 0;
      }
  }
  return;
}
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    int i, j, a, b, res = 0;
    memset(deg, 0, sizeof(deg));
    memset(mat, 0, sizeof(mat));
    for (i = 1; i <= m; i++) {
      scanf("%d%d", &a, &b);
      deg[a]++;
      deg[b]++;
      mat[a][b] = mat[b][a] = 1;
    }
    for (i = 1; i <= n * (n - 1) / 2; i++) {
      find();
      if (pos == 0) break;
      update();
      res++;
    }
    printf("%d\n", res);
  }
  return 0;
}
