#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  int adj[101][101] = {0}, a[101] = {0};
  int temp[101] = {0};
  int u, v;
  cin >> n >> m;
  while (m--) {
    cin >> u >> v;
    a[u]++;
    a[v]++;
    adj[u][v] = 1;
    adj[v][u] = 1;
  }
  int count1 = 1, res = 0;
  while (count1 > 0) {
    count1 = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] == 1) {
        temp[count1++] = i;
        a[i]--;
      }
    }
    for (int i = 0; i < count1; i++) {
      for (int j = 1; j <= n; j++) {
        if (adj[temp[i]][j]) {
          a[j]--;
        }
      }
    }
    res++;
  }
  cout << res - 1 << endl;
  return 0;
}
