#include <bits/stdc++.h>
using namespace std;
int n, k, a, b, w[1005], ct, c, g[1005][1005];
pair<int, int> u[1005];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= k; i++) {
    cin >> a >> b;
    g[a][b] = 1;
    g[b][a] = 1;
    w[a]++;
    w[b]++;
  }
  while (true) {
    ct = 0;
    for (int i = 1; i <= n; i++) {
      if (w[i] == 1) {
        for (int j = 1; j <= n; j++) {
          if (g[i][j] == 1) {
            u[++ct] = {i, j};
            break;
          }
        }
      }
    }
    if (ct == 0) {
      break;
    }
    c++;
    for (int i = 1; i <= ct; i++) {
      w[u[i].first]--;
      w[u[i].second]--;
      g[u[i].first][u[i].second] = 0;
      g[u[i].second][u[i].first] = 0;
      u[i].first = 0;
      u[i].second = 0;
    }
  }
  cout << c;
}
