#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n, m, ans = 0;
  cin >> n >> m;
  int g[n][n];
  memset(g, 0, sizeof(g));
  vector<int> v(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    g[--a][--b] = 1;
    g[b][a] = 1;
    v[a]++;
    v[b]++;
  }
  int l;
  do {
    vector<int> a;
    l = 0;
    for (int i = 0; i < n; i++) {
      if (v[i] == 1) {
        a.push_back(i);
        ++l;
        v[i] = 0;
      }
    }
    if (l) {
      ans++;
      for (int i = 0; i < a.size(); i++) {
        for (int j = 0; j < n; j++) {
          if (g[a[i]][j] == 1) {
            g[a[i]][j] = 0;
            g[j][a[i]] = 0;
            v[j]--;
          }
        }
      }
    }
  } while (l);
  cout << ans;
  return 0;
}
