#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[101] = {0}, z = 0, n, m, x, y, c[101][101] = {0}, l = -1;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    a[x]++;
    a[y]++;
    c[x][y] = 1;
    c[y][x] = 1;
  }
  do {
    int k[101] = {0};
    z = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] == 1) {
        k[z++] = i;
        a[i]--;
      }
    }
    for (int i = 0; i < z; i++) {
      for (int j = 1; j <= n; j++) {
        if (c[k[i]][j] != 0) a[j]--;
      }
    }
    l++;
  } while (z > 0);
  cout << l;
  return 0;
}
