#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
int n, m;
vector<vector<bool> > v;
int main() {
  cin >> n >> m;
  v = vector<vector<bool> >(n + 1, vector<bool>(n + 1, 0));
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    v[x][y] = 1;
    v[y][x] = 1;
  }
  bool q = true;
  int ans = 0;
  while (q) {
    bool w = false;
    vector<int> kick;
    for (int i = 1; i <= n; i++) {
      int cnt = 0;
      int y;
      for (int j = 1; j <= n; j++)
        if (v[i][j]) {
          cnt++;
          y = j;
        }
      if (cnt == 1) {
        kick.push_back(i);
        v[i][y] = 0;
      }
    }
    if (kick.size() > 0) {
      ans++;
      w = true;
      for (int i = 0; i < kick.size(); i++) {
        for (int j = 1; j <= n; j++) v[j][kick[i]] = 0;
      }
    }
    q = w;
  }
  cout << ans;
}
