#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int m;
  int sh1, sh2;
  bool ct1;
  int ct2 = 0, mes;
  bool bSch[100];
  bool adM[100][100];
  for (int i = 0; i < 100; ++i) {
    for (int j = 0; j < 100; ++j) adM[i][j] = 0;
  }
  cin >> n >> m;
  for (int j = 0; j < m; ++j) {
    cin >> sh1 >> sh2;
    adM[sh1 - 1][sh2 - 1] = 1;
    adM[sh2 - 1][sh1 - 1] = 1;
  }
  do {
    for (int i = 0; i < 100; ++i) bSch[i] = false;
    ++ct2;
    ct1 = false;
    for (int i = 0; i < n; ++i) {
      mes = 0;
      for (int j = 0; j < n; ++j) {
        if (adM[i][j] == 1) ++mes;
      }
      if (mes == 1) {
        ct1 = true;
        bSch[i] = true;
      }
    }
    for (int i = 0; i < 100; ++i) {
      if (bSch[i] == true) {
        for (int j = 0; j < 100; ++j) {
          adM[i][j] = 0;
          adM[j][i] = 0;
        }
      }
    }
  } while (ct1);
  cout << ct2 - 1;
}
