#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, k, x, y, rs = 0;
  int l[100], d[100];
  vector<int> a[100];
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    l[i] = 0;
  }
  for (i = 0; i < m; i++) {
    cin >> x >> y;
    x--;
    y--;
    a[x].push_back(y);
    a[y].push_back(x);
    l[x]++;
    l[y]++;
  }
  bool ok;
  while (1) {
    ok = true;
    for (i = 0; i < n; i++) {
      if (l[i] == 1) {
        d[i] = 1;
      } else {
        d[i] = 0;
      }
    }
    for (i = 0; i < n; i++) {
      if (d[i] == 1) {
        l[i] = 0;
        ok = false;
        a[i].empty();
        for (j = 0; j < n; j++) {
          if (i != j) {
            for (k = 0; k < l[j]; k++) {
              if (a[j][k] == i) {
                a[j].erase(a[j].begin() + k);
                l[j]--;
              }
            }
          }
        }
      }
    }
    if (ok) break;
    rs++;
  }
  cout << rs;
}
