#include <bits/stdc++.h>
using namespace std;
double pi = acos(-1);
void Open() {}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
void PrintNumber(int n, int len) {
  if (!len) return;
  cout << (n & 1);
}
void PrintAllSubset(int n) {
  for (int i = 0; i < (1 << n); i++) {
    PrintNumber(i, n);
    cout << "\n";
  }
}
void trr() {}
int main() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  map<pair<int, int>, int> mpp;
  map<int, int> mp;
  int x, y;
  vector<pair<int, int>> a(m);
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    a[i] = {x, y};
    mpp[{x, y}]++;
    mpp[{y, x}]++;
    mp[x]++;
    mp[y]++;
  }
  long long h = 0;
  while (true) {
    int c = 0;
    vector<int> r;
    for (int i = 0; i < a.size(); i++) {
      if (mp[a[i].first] == 0 || mp[a[i].second] == 0) continue;
      if (mp[a[i].first] == 1 || mp[a[i].second] == 1) {
        c++;
        r.push_back(i);
      }
    }
    for (int i = 0; i < r.size(); i++) {
      mp[a[r[i]].first]--;
      mp[a[r[i]].second]--;
    }
    if (c > 0)
      h++;
    else
      break;
  }
  cout << h;
}
