#include <bits/stdc++.h>
using namespace std;
int main() {
  int M[105][105];
  bool prohibidos[105];
  int n, m, x, y, castigados = 0;
  memset(M, 0, sizeof(M));
  memset(prohibidos, false, sizeof(prohibidos));
  scanf("%d %d\n", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d %d\n", &x, &y);
    x--;
    y--;
    M[x][y] = 1;
    M[y][x] = 1;
  }
  int aux = 1;
  vector<int> a_prohibir;
  while (aux) {
    aux = 0;
    a_prohibir.clear();
    for (int i = 0; i < n; i++) {
      if (!prohibidos[i]) {
        int cont = 0;
        for (int j = 0; j < n; j++) {
          if (i != j && !prohibidos[j])
            if (M[i][j] == 1) cont++;
        }
        if (cont == 1) {
          a_prohibir.push_back(i);
          aux++;
        }
      }
    }
    for (int i = 0; i < (int)a_prohibir.size(); i++)
      prohibidos[a_prohibir[i]] = true;
    if (aux) castigados++;
  }
  printf("%d\n", castigados);
  return 0;
}
