#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m, d[101] = {}, a, b, C, O = -1, i, j;
  bool c[101][101] = {};
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> a >> b;
    ++d[a];
    ++d[b];
    c[a][b] = 1;
    c[b][a] = 1;
  }
  do {
    long long int E[101] = {};
    C = 0;
    for (i = 1; i <= n; i++) {
      if (d[i] == 1) {
        E[C++] = i;
        --d[i];
      }
    }
    for (i = 0; i < C; i++)
      for (j = 1; j <= n; j++)
        if (c[E[i]][j]) --d[j];
    ++O;
  } while (C > 0);
  cout << O;
}
