#include <bits/stdc++.h>
int head[111], du[111], ans, n, m, p, cc, way[111];
struct md {
  int x, li;
} line[30000];
void make(int a, int b) {
  line[++p].x = b;
  line[p].li = head[a];
  head[a] = p;
  line[++p].x = a;
  line[p].li = head[b];
  head[b] = p;
  du[a]++;
  du[b]++;
}
int main() {
  int i, j, a, b, x;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &a, &b);
    make(a, b);
  }
  while (1) {
    cc = 0;
    for (i = 1; i <= n; i++)
      if (du[i] == 1) way[++cc] = i;
    if (cc < 1) break;
    ans++;
    for (j = 1; j <= cc; j++) {
      x = way[j];
      i = head[x];
      du[x]--;
      while (i) {
        du[line[i].x]--;
        i = line[i].li;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
