#include <bits/stdc++.h>
int main() {
  int n, m, d[101] = {}, a, b, cnt, sol = -1;
  bool c[101][101] = {};
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &a, &b);
    ++d[a];
    ++d[b];
    c[a][b] = 1;
    c[b][a] = 1;
  }
  do {
    int del[101] = {};
    cnt = 0;
    for (int i = 1; i <= n; ++i)
      if (d[i] == 1) {
        del[cnt++] = i;
        --d[i];
      }
    for (int i = 0; i < cnt; ++i)
      for (int j = 1; j <= n; ++j)
        if (c[del[i]][j]) --d[j];
    ++sol;
  } while (cnt > 0);
  printf("%d", sol);
  return 0;
}
