#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> niza[n + 1];
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    niza[a].push_back(b);
    niza[b].push_back(a);
  }
  int res = 0;
  while (true) {
    vector<int> id;
    for (int i = 1; i <= n; i++) {
      if (niza[i].size() == 1) {
        id.push_back(i);
      }
    }
    if (id.size() == 0) {
      break;
    }
    res++;
    for (int i = 0; i < id.size(); i++) {
      if (!niza[id[i]].empty()) {
        int tmp = niza[id[i]][0];
        niza[id[i]].pop_back();
        for (int j = 0; j < niza[tmp].size(); j++) {
          if (niza[tmp][j] == id[i]) {
            swap(niza[tmp][j], niza[tmp][niza[tmp].size() - 1]);
            niza[tmp].pop_back();
            break;
          }
        }
      }
    }
  }
  cout << res << endl;
  return 0;
}
