#include <bits/stdc++.h>
using namespace std;
int const sz = 1e5 + 2;
int adjmat[101][101];
int matsz[101];
int tmp[101];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int ans = 0;
  int a, b, mn = sz;
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &a, &b);
    adjmat[a][b] = 1;
    adjmat[b][a] = 1;
    matsz[a]++;
    matsz[b]++;
  }
  for (int i = 1; i <= n; i++) {
    if (matsz[i] > 0) mn = min(mn, matsz[i]);
  }
  if (mn == 1) {
    bool flag = true;
    while (flag) {
      flag = false;
      for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
          if (adjmat[i][j] && (matsz[i] == 1 || matsz[j] == 1)) {
            adjmat[i][j] = 0;
            adjmat[j][i] = 0;
            tmp[i]--;
            tmp[j]--;
            flag = true;
          }
        }
      }
      for (int i = 1; i <= n; i++) {
        matsz[i] += tmp[i];
        tmp[i] = 0;
      }
      if (flag) ans++;
    }
  }
  printf("%d", ans);
  return 0;
}
