#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long int i, j;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, count = 0;
  cin >> n >> m;
  vector<int> a(m), b(m);
  for (i = 0; i < m; ++i) {
    int x, y;
    cin >> x >> y;
    a[i] = x;
    b[i] = y;
  }
  int t = 0;
  do {
    t = 0;
    map<int, int> d;
    for (i = 0; i < a.size(); ++i) {
      d[a[i]]++;
      d[b[i]]++;
    }
    for (i = 1; i < n + 1; ++i)
      if (d[i] == 1) t = 1;
    if (t) {
      count++;
      for (i = 1; i < n + 1; ++i) {
        if (d[i] == 1) {
          d[i] = 0;
          for (j = 0; j < a.size(); ++j) {
            if (a[j] == i or b[j] == i) {
              a.erase(a.begin() + j);
              b.erase(b.begin() + j);
            }
          }
        }
      }
    }
  } while (t);
  cout << count;
  return 0;
}
