#include <bits/stdc++.h>
using namespace std;
long long int arr[500], brr[500], q[500][500];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    arr[u]++;
    arr[v]++;
    q[u][v] = 1;
    q[v][u] = 1;
    brr[u] = arr[u], brr[v] = arr[v];
  }
  int ans = 0, k;
  for (int i = 1; i <= n; i++) {
    k = 0;
    for (int l = 1; l <= n; l++)
      if (arr[l] == 1) {
        k = 1;
        brr[l] = 0;
        for (int j = 1; j <= n; j++)
          if (q[l][j] == 1) brr[j] = brr[j] - 1;
      }
    if (k == 1) ans = ans + k;
    for (int k1 = 1; k1 <= n; k1++) arr[k1] = brr[k1];
  }
  cout << ans << endl;
}
