#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int i, j;
  long long T;
  int n, l, r, x, y, k, m;
  int b, c;
  int a[111][111];
  int cur_size[111];
  int gr[111];
  for (i = 0; i < 111; ++i) {
    for (j = 0; j < 111; ++j) {
      a[i][j] = false;
    }
    cur_size[i] = false;
  }
  cin >> n >> m;
  for (i = 0; i < m; ++i) {
    cin >> b >> c;
    a[b][c] = true;
    a[c][b] = true;
    cur_size[b]++;
    cur_size[c]++;
  }
  int odp = 0;
  bool p = 1;
  while (true) {
    p = 0;
    bool h;
    y = 1;
    for (i = 1; i < n + 1; ++i) {
      if (cur_size[i] == 1) {
        gr[y++] = i;
      }
    }
    if (y == 1) break;
    odp++;
    for (i = 1; i < y; ++i) {
      cur_size[gr[i]] = 0;
      for (j = 1; j < n + 1; ++j) {
        if (a[gr[i]][j]) {
          cur_size[j]--;
          a[gr[i]][j] = false;
        }
      }
    }
  }
  cout << odp;
  return 0;
}
