#include <bits/stdc++.h>
using namespace std;
int main() {
  bool a[101][101] = {0};
  int d[101] = {0}, p[101] = {0};
  int n, m, i1, i2;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> i1 >> i2;
    d[i1]++;
    d[i2]++;
    a[i1][i2] = a[i2][i1] = true;
  }
  int ans = 0;
  for (;;) {
    bool f = false;
    for (int i = 1; i <= n; i++)
      if (d[i] == 1) {
        p[i] = ans + 1;
        f = true;
      }
    if (f == false) break;
    ans++;
    for (int i = 1; i <= n; i++) {
      if (p[i] == ans) {
        d[i] = 0;
        for (int j = 1; j <= n; j++)
          if (a[i][j]) {
            a[i][j] = a[j][i] = false;
            d[j]--;
          }
      }
    }
  }
  cout << ans;
  return 0;
}
