#include <bits/stdc++.h>
using namespace std;
int s[105];
int x[105][105];
int main() {
  int i, j, n, m, q, w, a[1000];
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d%d", &q, &w);
    x[q][w] = x[w][q] = 1;
    s[q]++;
    s[w]++;
  }
  int c = 0, p = 0, ans = 0;
  while (1) {
    c = 0;
    for (i = 1; i <= n; i++)
      if (s[i] == 1) a[c++] = i;
    if (c == 0)
      break;
    else
      ans++;
    for (j = 0; j < c; j++) {
      s[a[j]] = 0;
      for (i = 1; i <= n; i++) {
        if (x[a[j]][i] == 1) {
          s[i]--;
          x[a[j]][i] = x[i][a[j]] = 0;
        }
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
