#include <bits/stdc++.h>
using namespace std;
inline const char nl = '\n';
inline const long long MOD = 1000000007;
inline const long double pi = 3.141592653589793238;
int fscn() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  int sg = 0;
  if (c == '-') {
    c = getchar();
    sg = 1;
  }
  int ret = 0;
  while (c >= '0' && c <= '9') {
    ret = ret * 10 + c - '0';
    c = getchar();
  }
  return sg ? -ret : ret;
}
void solve() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n = fscn(), m = fscn();
  long long count = 0, a, b;
  set<long long> arr[n + 1];
  for (long long i = 0; i < m; i++) {
    a = fscn(), b = fscn();
    arr[a].insert(b);
    arr[b].insert(a);
  }
  bool sum = 1;
  vector<pair<long long, long long>> v;
  while (sum) {
    sum = 0;
    v.clear();
    for (long long i = 1; i < n + 1; i++) {
      if (arr[i].size() == 1) {
        sum = 1;
        v.push_back(make_pair(i, *arr[i].begin()));
      }
    }
    for (auto u : v) {
      arr[u.first].erase(u.second);
      arr[u.second].erase(u.first);
    }
    if (sum) count++;
  }
  cout << count << nl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  solve();
  return 0;
}
