#include <bits/stdc++.h>
using namespace std;
const int NMAX = 101;
vector<int> v[NMAX];
vector<pair<int, int> > p;
int main() {
  int n, m, a, b;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  int ans = 0;
  bool flag = true;
  while (flag) {
    flag = false;
    for (int i = 1; i <= n; i++) {
      if (v[i].size() != 1) continue;
      flag = true;
      p.push_back(make_pair(i, v[i][0]));
    }
    for (int i = 0; i < p.size(); i++) {
      v[p[i].first].clear();
      for (int j = 0; j < v[p[i].second].size(); j++) {
        if (v[p[i].second][j] != p[i].first) continue;
        v[p[i].second].erase(v[p[i].second].begin() + j);
        break;
      }
    }
    if (flag) ans++;
  }
  cout << ans;
  return 0;
}
