#include <bits/stdc++.h>
using namespace std;
const double pi = 3.14159265359;
const long long int Maxi = 1e18;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, i, j, l, k = 0, p = 0, s = 0, t = 1, x, y, z, r, c;
  vector<long long> ar[1000];
  long long mp[1000];
  long long a[1000] = {0};
  long long flag = 0, ans = 0;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> x >> y;
    ar[x].push_back(y);
    ar[y].push_back(x);
    a[x]++;
    a[y]++;
  }
  flag = 1;
  while (flag) {
    flag = 0;
    k = 0;
    for (i = 1; i <= n; i++) {
      if (a[i] == 1) {
        flag = 1;
        mp[k++] = i;
      }
    }
    for (i = 0; i < k; i++) {
      a[mp[i]]--;
      for (j = 0; j < ar[mp[i]].size(); j++) a[ar[mp[i]][j]]--;
    }
    if (flag) ans++;
  }
  cout << ans;
  return 0;
}
