#include <bits/stdc++.h>
using namespace std;
using namespace std;
bool debug = 1;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int amn[n + 1];
  vector<vector<int> > v;
  v.resize(n + 1);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    v[a].push_back(b);
    v[b].push_back(a);
    amn[a]++;
    amn[b]++;
  }
  bool fs[n + 1];
  fill(fs, fs + n + 1, 0);
  if (0)
    for (int i = 1; i <= n; i++)
      if (v[i].size() == 1) fs[i] = 1;
  int k = 0;
  bool is;
  do {
    bool nfs[n + 1];
    for (int i = 1; i <= n; i++) nfs[i] = fs[i];
    is = 0;
    k++;
    for (int i = 1; i <= n; i++) {
      if (fs[i]) continue;
      int amnoth = 0;
      for (int j = 0; j < v[i].size(); j++) {
        int oth = v[i][j];
        if (!fs[oth]) amnoth++;
      }
      if (amnoth == 1) {
        nfs[i] = 1;
        is = 1;
      }
    }
    for (int i = 1; i <= n; i++) fs[i] = nfs[i];
  } while (is);
  printf("%d\n", k - 1);
  return 0;
}
