#include <bits/stdc++.h>
using namespace std;
vector<int> graph[105];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int v, u;
    cin >> v >> u;
    v--;
    u--;
    graph[v].push_back(u);
    graph[u].push_back(v);
  }
  vector<int> group;
  bool ok = false;
  int cnt = 0;
  while (!ok) {
    ok = true;
    for (int i = 0; i < n; i++) {
      if (graph[i].size() == 1) {
        group.push_back(i);
        ok = false;
      }
    }
    for (int i = 0; i < group.size(); i++) {
      graph[group[i]].clear();
      for (int j = 0; j < n; j++) {
        auto pos = find(graph[j].begin(), graph[j].end(), group[i]);
        if (pos != graph[j].end()) graph[j].erase(pos);
      }
    }
    group.clear();
    cnt++;
  }
  cout << cnt - 1;
  return 0;
}
