#include <bits/stdc++.h>
using namespace std;
int n, m;
int arr[100000 + 10];
vector<int> w[100000 + 10];
bool check() {
  for (int i = 1; i <= n; i++)
    if (arr[i] == 1) return true;
  return false;
}
int main() {
  int a, b;
  cin >> n >> m;
  while (m--) {
    cin >> a >> b;
    arr[a]++, arr[b]++;
    w[a].push_back(b), w[b].push_back(a);
  }
  int sum = 0;
  bool flag;
  vector<int> v;
  do {
    v.clear(), flag = false;
    for (int i = 1; i <= n; i++) {
      if (arr[i] == 1) {
        v.push_back(i);
        arr[i] = 0;
        flag = true;
      }
    }
    if (flag) sum++;
    for (int i = 0; i < v.size(); i++) {
      for (int j = 0; j < w[v[i]].size(); j++)
        if (arr[w[v[i]][j]]) arr[w[v[i]][j]]--;
    }
  } while (check());
  cout << sum << endl;
  return 0;
}
