#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> v(101);
bool dfs(int n) {
  vector<int> vec;
  for (int i = 1; i <= n; i++) {
    if (v[i].size() == 1) vec.push_back(i);
  }
  if (vec.size() == 0) return false;
  for (int i = 0; i < vec.size(); i++) {
    int x = v[vec[i]][0];
    v[vec[i]].clear();
    v[x].erase(remove(v[x].begin(), v[x].end(), vec[i]), v[x].end());
  }
  return true;
}
int main() {
  int n, m;
  cin >> n >> m;
  int a, b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  int ans = 0;
  while (dfs(n)) ans++;
  cout << ans;
}
