#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<set<int> > graph;
int main() {
  cin >> n >> m;
  graph.resize(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    graph[a].insert(b);
    graph[b].insert(a);
  }
  vector<int> fuckedout(n, 0);
  int ans = 0;
  while (1) {
    int cnt = 0;
    vector<int> fuckout(n, 0);
    for (int i = 0; i < n; ++i)
      if (!fuckedout[i]) {
        if (graph[i].size() == 1) {
          fuckout[i] = 1;
          cnt++;
        }
      }
    if (cnt == 0) break;
    ans++;
    for (int i = 0; i < n; ++i)
      if (fuckout[i]) {
        fuckedout[i] = 1;
        if (graph[i].size() != 0) {
          int to = *(graph[i].begin());
          graph[i].clear();
          graph[to].erase(i);
        }
      }
  }
  cout << ans << endl;
}
