#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  unordered_set<int> adj[n + 1];
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    adj[a].insert(b);
    adj[b].insert(a);
  }
  int count = 0;
  while (1) {
    vector<pair<int, int> > temp;
    bool done = false;
    for (int i = 1; i < n + 1; ++i) {
      if ((int)adj[i].size() == 1) {
        done = true;
        temp.push_back(make_pair(*(adj[i].begin()), i));
        adj[i].clear();
      }
    }
    if (!done) {
      break;
    }
    for (int i = 0; i < (int)temp.size(); ++i) {
      int x = temp[i].first;
      int y = temp[i].second;
      adj[x].erase(y);
    }
    ++count;
  }
  cout << count << "\n";
}
