#include <bits/stdc++.h>
using namespace std;
const int N = 102;
map<int, pair<int, vector<int>>> adj;
vector<vector<int>> kicked_;
int ans, n;
bool kicking() {
  bool kicked = false;
  for (int i = 1; i <= n; i++) {
    if (adj[i].first == 1) {
      adj[i].first--;
      kicked_.push_back(adj[i].second);
      kicked = true;
    }
  }
  for (auto v : kicked_) {
    for (auto x : v) {
      adj[x].first--;
    }
  }
  kicked_.clear();
  if (kicked) {
    ans++;
    return true;
  }
  return false;
}
int main() {
  int m, a, b;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    adj[a].first++;
    adj[a].second.push_back(b);
    adj[b].first++;
    adj[b].second.push_back(a);
  }
  bool loop = true;
  while (loop) {
    loop = kicking();
  }
  cout << ans;
  return 0;
}
