#include <bits/stdc++.h>
using namespace std;
const long long INF = 999999999999999999;
const double PI = acos(-1.0);
void stop() { exit(0); }
bool A[105][105];
long long kol[105];
int main() {
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  long long a, b;
  for (long long i = 0; i < m; i++) {
    cin >> a >> b;
    A[a][b] = 1;
    A[b][a] = 1;
    kol[a]++;
    kol[b]++;
  }
  for (long long res = 0; res <= n; res++) {
    vector<long long> v;
    for (long long i = 1; i <= n; i++) {
      if (kol[i] == 1) v.push_back(i);
    }
    if (v.size() == 0) {
      cout << res;
      stop();
    }
    for (long long i = 0; i < v.size(); i++) {
      a = v[i];
      kol[a] = 0;
      for (long long j = 1; j <= n; j++) {
        if (A[a][j]) {
          A[a][j] = 0;
          A[j][a] = 0;
          kol[j]--;
        }
      }
    }
  }
  cout << n;
  stop();
}
