#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> map[110];
  int n, m, u, v;
  int du[110];
  scanf("%d %d", &n, &m);
  memset(du, 0, sizeof(du));
  for (int i = 1; i <= 100; i++) map[i].clear();
  int ans = 0;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &u, &v);
    du[u]++;
    du[v]++;
    map[u].push_back(v);
    map[v].push_back(u);
  }
  int flag;
  while (1) {
    vector<int> y;
    y.clear();
    flag = 0;
    for (int i = 1; i <= n; i++)
      if (du[i] == 1) {
        du[i]--;
        y.push_back(i);
        flag = 1;
      }
    for (int i = 0; i < y.size(); i++) {
      int uu = y[i];
      for (int j = 0; j < map[uu].size(); j++) {
        int vv = map[uu][j];
        du[vv]--;
      }
    }
    if (flag == 1)
      ans++;
    else
      break;
  }
  printf("%d\n", ans);
  return 0;
}
