#include <bits/stdc++.h>
using namespace std;
long long int cycle(long long int s, vector<long long int> adj[],
                    vector<bool> &visited) {
  visited[s] = true;
  for (int i = 0; i < adj[s].size(); i++) {
    if (visited[adj[s][i]]) return adj[s][i];
    return cycle(adj[s][i], adj, visited);
  }
}
void solve() {
  long long int n, m, u, v;
  cin >> n >> m;
  vector<vector<bool> > a(n + 1, vector<bool>(n + 1, false));
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    a[u][v] = true;
    a[v][u] = true;
  }
  long long int ans, x, y, c;
  ans = 0;
  bool flag;
  flag = true;
  while (flag) {
    flag = false;
    vector<pair<long long int, long long int> > vp;
    for (int i = 1; i < n + 1; i++) {
      c = 0;
      for (int j = 1; j < n + 1; j++) {
        if (a[i][j]) {
          c++;
          x = i;
          y = j;
        }
      }
      if (c == 1) {
        vp.push_back({x, y});
        flag = true;
      }
    }
    for (int i = 0; i < vp.size(); i++) {
      a[vp[i].first][vp[i].second] = false;
      a[vp[i].second][vp[i].first] = false;
    }
    if (flag) ans++;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
