#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[110] = {0}, res = 0, fir[10010], sec[10010];
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    fir[i] = x;
    sec[i] = y;
    a[x]++;
    a[y]++;
  }
  bool bol = 1;
  while (bol) {
    bol = 0;
    int b[110];
    for (int i = 1; i <= n; i++) b[i] = a[i];
    for (int i = 1; i <= n; i++)
      if (b[i] == 1) {
        bol = 1;
        for (int j = 0; j < m; j++) {
          if (fir[j] == i || sec[j] == i) {
            a[sec[j]]--;
            a[fir[j]]--;
          }
        }
      }
    if (bol) res++;
  }
  cout << res << endl;
  return 0;
}
