#include <bits/stdc++.h>
using namespace std;
struct lance {
  int a, b;
  bool isTied = true;
};
int main() {
  int n, m, sum = 0;
  cin >> n >> m;
  struct lance s[10000];
  for (int i = 0; i < m; ++i) {
    cin >> s[i].a >> s[i].b;
  }
  for (int i = 1; i <= n; ++i) {
    int nl[101] = {0}, sof[101] = {0};
    for (int j = 0; j < m; ++j) {
      if (s[j].isTied) {
        nl[s[j].a]++;
        nl[s[j].b]++;
        sof[s[j].a] = j;
        sof[s[j].b] = j;
      }
    }
    bool flag = true;
    for (int j = 1; j <= n; ++j) {
      if (nl[j] == 1) {
        flag = false;
        s[sof[j]].isTied = false;
      }
    }
    if (flag) {
      break;
    } else {
      sum++;
    }
  }
  cout << sum;
  return 0;
}
