#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 5;
long long arr[N];
long long l[N];
long long r[N];
vector<long long> adj[N];
long long vis[N] = {0};
long long first[N];
long long second[N];
long long n, m;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
bool okay(long long num) {
  for (long long i = 0; i < n; i++) {
    l[i] = arr[i];
    r[i] = (arr[i] + num) % m;
  }
  long long curr = 0;
  for (long long i = 0; i < n; i++) {
    if (r[i] >= l[i]) {
      if (curr > r[i]) return 0;
      curr = max(curr, l[i]);
    } else {
      if (curr > r[i]) {
        curr = max(curr, l[i]);
      }
    }
  }
  return 1;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  vector<vector<long long> > v(n);
  for (long long i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    --a, --b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  long long ans = 0;
  while (1) {
    vector<long long> temp;
    for (long long i = 0; i < n; i++) {
      if (v[i].size() == 1) {
        temp.push_back(i);
      }
    }
    if (temp.size() == 0) break;
    ans++;
    for (long long i = 0; i < temp.size(); i++) {
      for (long long j = 0; j < n; j++) {
        if (j == temp[i]) {
          v[j].clear();
          continue;
        }
        v[j].erase(remove((v[j]).begin(), (v[j]).end(), temp[i]), v[j].end());
      }
    }
  }
  cout << ans << '\n';
}
int32_t main() {
  fast();
  long long t = 1;
  while (t--) solve();
}
