#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> elements1(n + 1, 0);
  vector<int> count(n + 1, 0);
  vector<pair<int, int> > pairs;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    elements1[x] = y;
    count[x] += 1;
    count[y] += 1;
    pairs.push_back(make_pair(x, y));
  }
  int result = 0;
  while (1) {
    vector<int> temp;
    int cc = 0;
    for (int i = 1; i < n + 1; i++) {
      if (count[i] == 1) {
        temp.push_back(i);
        cc += 1;
      }
    }
    if (cc != 0) {
      result += 1;
      for (int j = temp.size() - 1; j >= 0; j--) {
        count[temp[j]] -= 1;
        for (int k = 0; k < pairs.size(); k++) {
          if (pairs[k].first == temp[j]) {
            count[pairs[k].second] -= 1;
            pairs.erase(pairs.begin() + k);
            break;
          }
          if (pairs[k].second == temp[j]) {
            count[pairs[k].first] -= 1;
            pairs.erase(pairs.begin() + k);
            break;
          }
        }
      }
    } else {
      break;
    }
  }
  cout << result << endl;
}
