#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m;
  cin >> n >> m;
  vector<long long> adj[n];
  for (long long i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  long long cnt = 0;
  while (true) {
    map<long long, long long> m;
    long long c = 0;
    for (long long i = 0; i < n; i++) {
      if (adj[i].size() == 1) {
        m[i] = 1;
        adj[i].clear();
        c++;
      }
    }
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < adj[i].size(); j++) {
        if (m[adj[i][j]]) {
          adj[i].erase(adj[i].begin() + j);
          j--;
        }
      }
    }
    if (!c)
      break;
    else
      cnt++;
  }
  cout << cnt;
  return 0;
}
