#include <bits/stdc++.h>
using namespace std;
int n, e;
vector<int> ar[200];
int main(void) {
  cin >> n >> e;
  int deg[n + 1];
  memset(deg, 0, sizeof deg);
  for (int i = 0; i < e; i++) {
    int s, d;
    cin >> s >> d;
    ar[s].push_back(d);
    ar[d].push_back(s);
    deg[s]++;
    deg[d]++;
  }
  int c = 0;
  while (true) {
    bool flag = false;
    for (int i = 1; i <= n; i++) {
      if (deg[i] == 1) {
        flag = true;
        deg[i] = -1;
      }
    }
    if (!flag) break;
    c++;
    for (int i = 1; i <= n; i++) {
      if (deg[i] == -1) {
        deg[i] = 0;
        deg[ar[i][0]]--;
        ar[ar[i][0]].erase(
            std::remove(ar[ar[i][0]].begin(), ar[ar[i][0]].end(), i),
            ar[ar[i][0]].end());
      }
    }
  }
  cout << c << endl;
  return 0;
}
