#include <bits/stdc++.h>
using namespace std;
const long long N = 1e+2 + 5;
long long big = 1e+18 + 3;
long long mod = 1e+9 + 7;
set<long long> gr[N];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    long long u, v;
    cin >> u >> v;
    gr[u].insert(v);
    gr[v].insert(u);
  }
  long long ans = 0;
  while (true) {
    vector<long long> kick;
    for (long long i = 1; i <= n; i++)
      if (gr[i].size() == 1) kick.push_back(i);
    if (!kick.size()) break;
    ans++;
    for (auto it : kick) {
      long long key = *(gr[it].begin());
      if (gr[key].find(it) != gr[key].end()) gr[key].erase(gr[key].find(it));
      if (gr[it].find(key) != gr[it].end()) gr[it].erase(gr[it].find(key));
    }
  }
  cout << ans << "\n";
}
