#include <bits/stdc++.h>
using namespace std;
bool x[101][101];
bool f = true;
int i, j, n, k, m, s = 0, p;
int a, b;
pair<int, int> y[101];
int main() {
  cin >> n;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) x[i][j] = false;
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> a;
    cin >> b;
    x[a][b] = true;
    x[b][a] = true;
  }
  while (f == true) {
    f = false;
    k = 1;
    for (i = 1; i <= n; i++) {
      p = 0;
      a = i;
      for (j = 1; j <= n; j++) {
        if (x[i][j] == true) {
          p++;
          b = j;
        }
      }
      if (p == 1) {
        f = true;
        y[k].first = a;
        y[k].second = b;
        k++;
      }
    }
    for (j = 1; j < k; j++) {
      x[y[j].first][y[j].second] = false;
      x[y[j].second][y[j].first] = false;
    }
    if (f == true) s++;
  }
  cout << s;
  return 0;
}
