#include <bits/stdc++.h>
short g[100][100];
short c[100];
short v[100];
short t[100];
void solve(int n) {
  int i, j, k, flag, ans;
  ans = 0;
  memset(v, 0, sizeof(v));
  while (1) {
    flag = 0;
    k = 0;
    for (i = 0; i < n; i++) {
      if (v[i] == 0) {
        if (c[i] == 1) {
          v[i] = 1;
          flag = 1;
          t[k++] = i;
        }
      }
    }
    if (flag == 0) {
      break;
    }
    ans++;
    for (i = 0; i < n; i++) {
      if (v[i] == 0) {
        for (j = 0; j < k; j++) {
          if (g[i][t[j]] == 1) {
            c[i]--;
          }
        }
      }
    }
  }
  printf("%d\n", ans);
}
int main() {
  int n, m, i, a, b;
  while (scanf("%d%d", &n, &m) == 2) {
    memset(c, 0, sizeof(c));
    memset(g, 0, sizeof(g));
    for (i = 0; i < m; i++) {
      scanf("%d%d", &a, &b);
      g[a - 1][b - 1] = g[b - 1][a - 1] = 1;
      c[a - 1]++;
      c[b - 1]++;
    }
    solve(n);
  }
  return 0;
}
