#include <bits/stdc++.h>
using namespace std;
bool vis[100005] = {0};
vector<int> v[100005];
int mod(int n) {
  if (n >= 0)
    return n;
  else
    return (-n);
}
void dfs(int n) {
  vis[n] = 1;
  for (auto k : v[n]) {
    if (vis[k])
      continue;
    else
      dfs(k);
  }
}
void solve() {
  int n, m, ans = 0;
  cin >> n >> m;
  vector<int> v[n + 1];
  vector<int> c(n + 1);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 1; i < n + 1; i++) {
    c[i] = v[i].size();
  }
  while (1) {
    int co = 0;
    vector<int> u;
    for (int i = 1; i < n + 1; i++) {
      if (c[i] == 1) {
        u.push_back(i);
        co++;
      }
    }
    for (int i = 0; i < u.size(); i++) {
      if (c[u[i]] == 1) {
        c[u[i]]--;
        int d = v[u[i]][0];
        std::vector<int>::iterator position =
            std::find(v[d].begin(), v[d].end(), u[i]);
        if (position != v[d].end()) v[d].erase(position);
        c[d]--;
      }
    }
    if (co > 0) {
      ans++;
    } else
      break;
  }
  cout << ans;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
