#include <bits/stdc++.h>
using namespace std;
int graph[105][105];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t, n, m, i, j, k, l, ans = 0, count = 0, flag = 0, temp;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> j >> k;
    graph[k][j] = 1;
    graph[j][k] = 1;
  }
  vector<pair<int, int> > v;
  while (1) {
    flag = 0;
    for (i = 1; i <= n; i++) {
      count = 0;
      for (l = 1; l <= n; l++) {
        if (graph[i][l] == 1) {
          count++;
          temp = l;
        }
      }
      if (count == 1) {
        graph[i][temp] = 0;
        v.push_back({i, temp});
        flag = 1;
      }
    }
    if (flag) {
      ans++;
      for (l = 0; l < v.size(); l++) {
        graph[v[l].second][v[l].first] = 0;
      }
      v.empty();
    }
    if (!flag) break;
  }
  cout << ans;
}
