#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, cnt = 0;
  cin >> N >> M;
  int adj[101][101] = {
      0,
  };
  while (M--) {
    int u, v;
    cin >> u >> v;
    adj[u][v]++;
    adj[v][u]++;
  }
  while (true) {
    int sum[101] = {
        0,
    };
    vector<int> willKick;
    for (int i = 1; i <= N; i++) {
      for (int j = 1; j <= N; j++)
        if (adj[i][j]) sum[i]++;
      if (sum[i] == 1) willKick.push_back(i);
    }
    if (willKick.empty()) break;
    for (int i = 1; i <= N; i++)
      for (int j = 1; j <= N; j++)
        if (sum[i] == 1 || sum[j] == 1) adj[i][j] = 0;
    cnt++;
  }
  cout << cnt;
}
