#include <bits/stdc++.h>
using namespace std;
int a[110][110], b[110][110];
bool check(int n) {
  for (int i = 0; i < n; i++) {
    int count = 0;
    for (int j = 0; j < n; j++)
      if (a[i][j] == 1) count++;
    if (count == 1) return true;
  }
  return false;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int ap, b;
    cin >> ap >> b;
    a[ap - 1][b - 1] = 1;
    a[b - 1][ap - 1] = 1;
  }
  int counter = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) b[i][j] = a[i][j];
  while (check(n)) {
    bool fl = false;
    for (int i = 0; i < n; i++) {
      int count = 0;
      for (int j = 0; j < n; j++)
        if (a[i][j] == 1) count++;
      if (count == 1) {
        fl = true;
        for (int k = 0; k < n; k++) {
          if (a[k][i] == 1) b[k][i] = 0;
          b[i][k] = 0;
        }
      }
    }
    if (fl == true) counter++;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) a[i][j] = b[i][j];
  }
  cout << counter << endl;
  return 0;
}
