#include <bits/stdc++.h>
using namespace std;
struct coor {
  int i;
  int j;
  coor(int x, int y) : i(x), j(y) {}
};
int main(int argc, char** argv) {
  int n = 0, count = 0, sh = 0;
  cin >> n >> sh;
  vector<vector<bool> > array(n, vector<bool>(n));
  vector<coor> co;
  for (int i = 0; i < sh; ++i) {
    int one = 0, two = 0;
    cin >> one >> two;
    array[one - 1][two - 1] = array[two - 1][one - 1] = true;
  }
  bool again = true, del = false;
  int num = 0;
  while (again) {
    del = false;
    again = false;
    for (int i = 0; i < n; ++i) {
      count = 0;
      for (int j = 0; j < n; ++j) {
        if (array[i][j]) {
          if (count > 1) {
            break;
          } else {
            count++;
          }
        }
      }
      if (count == 1) {
        for (int k = 0; k < n; ++k) {
          if (array[i][k]) {
            co.push_back(coor(i, k));
            break;
          }
        }
        del = true;
      }
    }
    for (vector<coor>::iterator t = co.begin(); t < co.end(); ++t) {
      array[t->i][t->j] = array[t->j][t->i] = false;
    }
    co.clear();
    if (del) {
      num++;
      again = true;
    }
  }
  cout << num;
  return 0;
}
