#include <bits/stdc++.h>
using namespace std;
vector<int> adj[105];
vector<pair<int, int> > idx;
int n, m, u, v, cnt;
bool b;
inline void sort_adj() {
  for (int i = 0; i <= n; i++) sort(adj[i].begin(), adj[i].end());
}
int solve() {
  while (1) {
    for (int i = 0; i <= n; i++) {
      if (adj[i].size() == 1) {
        idx.push_back({adj[i][0], i});
        adj[i].clear();
      }
    }
    if (idx.size()) {
      cnt++;
      for (int i = 0; i < idx.size(); i++) {
        b = binary_search(adj[idx[i].first].begin(), adj[idx[i].first].end(),
                          idx[i].second);
        if (b)
          adj[idx[i].first].erase(lower_bound(adj[idx[i].first].begin(),
                                              adj[idx[i].first].end(),
                                              idx[i].second));
      }
    } else
      break;
    idx.clear();
  }
  return cnt;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  sort_adj();
  cout << solve();
  return 0;
}
