#include <bits/stdc++.h>
using namespace std;
int n, m, a, b, cnt, v[101];
int y[101][101];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a >> b;
    y[a][b] = y[b][a] = true;
  }
  while (1) {
    for (int i = 1; i <= n; i++) {
      int x = 0;
      for (int j = 1; j <= n; j++) {
        if (y[i][j] == true) {
          x++;
        }
      }
      if (x == 1 && v[i] == 0) v[i] = 1;
    }
    int s = 0;
    for (int i = 1; i <= n; i++) {
      if (v[i] == 1) {
        s++;
        v[i] = 2;
        for (int j = 1; j <= n; j++) {
          y[i][j] = y[j][i] = false;
        }
      }
    }
    if (s == 0) break;
    cnt++;
  }
  cout << cnt;
  return 0;
}
