#include <bits/stdc++.h>
using namespace std;
int main() {
  int connected[101] = {0}, groups = 0;
  int n, m;
  cin >> n >> m;
  vector<int> adj[n + 1];
  while (m--) {
    int u, v;
    cin >> u >> v;
    connected[u]++;
    connected[v]++;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  queue<int> q;
  for (int i = 1; i <= n; i++) {
    if (connected[i] == 1) {
      q.push(i);
    }
  }
  while (!q.empty()) {
    bool removed = false;
    for (int j = q.size(); j >= 1; j--) {
      int x = q.front();
      q.pop();
      if (connected[x] == 1) {
        removed = true;
        connected[x]--;
        for (int i = 0; i < adj[x].size(); i++) {
          connected[adj[x][i]]--;
          if (connected[adj[x][i]] == 1) q.push(adj[x][i]);
        }
      }
    }
    if (removed) groups++;
  }
  cout << groups << "\n";
  return 0;
}
