#include <bits/stdc++.h>
using namespace std;
long long int arr[200][200], deg[200];
stack<pair<long long int, long long int> > stk;
int main() {
  long long int n, m;
  cin >> n >> m;
  for (long long int i = 0; i < m; i++) {
    long long int u, v;
    cin >> u >> v;
    deg[u]++;
    deg[v]++;
    arr[u][v] = 1;
    arr[v][u] = 1;
  }
  long long int ans = 0;
  while (1) {
    int f = 0;
    for (long long int i = 1; i <= n; i++) {
      if (deg[i] == 1) {
        f = 1;
        for (long long int j = 1; j <= n; j++) {
          if (arr[i][j] == 1) {
            stk.push(make_pair(i, j));
            break;
          }
        }
      }
    }
    if (f == 0) break;
    ans++;
    while (!stk.empty()) {
      pair<long long int, long long int> temp = stk.top();
      deg[temp.first]--;
      deg[temp.second]--;
      arr[temp.first][temp.second] = 0;
      arr[temp.second][temp.first] = 0;
      stk.pop();
    }
  }
  cout << ans << endl;
  return 0;
}
