#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, a[105][105], a1, a2, i, j, b[105], k1, num;
  while (~scanf("%d%d", &n, &m)) {
    k = k1 = num = 0;
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    for (i = 1; i <= m; i++) {
      scanf("%d%d", &a1, &a2);
      a[a1][a2]++;
      a[a2][a1]++;
    }
    while (1) {
      k1 = 0;
      for (i = 1; i <= n; i++) {
        for (j = 1; j <= n; j++) {
          if (a[i][j] == 1) {
            k++;
          }
        }
        if (k == 1) {
          b[i] = 1;
        }
        k = 0;
      }
      for (i = 1; i <= n; i++) {
        if (b[i] == 0) {
          k1++;
        }
      }
      if (k1 == n) {
        break;
      }
      for (i = 1; i <= n; i++) {
        if (b[i] == 1) {
          for (j = 1; j <= n; j++) {
            a[i][j] = 0;
            a[j][i] = 0;
          }
          b[i] = 0;
        }
      }
      num++;
    }
    printf("%d\n", num);
  }
  return 0;
}
