#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int adj[101][101];
  memset(adj, 0, sizeof(adj));
  int indegree[101] = {0};
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    adj[a][b] = 1;
    adj[b][a] = 1;
    indegree[a]++;
    indegree[b]++;
  }
  int ans = 0;
  vector<int> s;
  while (true) {
    int flag = 0;
    s.clear();
    for (int i = 1; i <= n; i++) {
      if (indegree[i] == 1) {
        s.push_back(i);
        indegree[i]--;
        flag = 1;
      }
    }
    for (int p : s) {
      for (int j = 1; j <= n; j++) {
        if (adj[p][j]) {
          adj[p][j] = 0;
          adj[j][p] = 0;
          indegree[j]--;
        }
      }
    }
    if (flag == 1)
      ans++;
    else
      break;
  }
  cout << ans << endl;
  return 0;
}
