#include <bits/stdc++.h>
using namespace std;
int deg[110];
vector<int> G[110];
int V[110];
int main() {
  int n, m;
  scanf("%d", &n), scanf("%d", &m);
  memset(deg, 0, sizeof(deg));
  memset(V, 0, sizeof(V));
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d", &u), scanf("%d", &v);
    deg[u]++;
    deg[v]++;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  bool ok = true;
  int cnt = 0;
  vector<int> Res;
  while (ok) {
    Res.clear();
    for (int i = 1; i <= n; i++) {
      if (deg[i] == 1 && V[i] == 0) {
        V[i] = 1;
        deg[i]--;
        Res.push_back(i);
      }
    }
    if (Res.size() == 0) break;
    cnt++;
    for (int i = 0; i < Res.size(); i++) {
      for (int j = 0; j < G[Res[i]].size(); j++) {
        deg[G[Res[i]][j]]--;
      }
    }
  }
  printf("%d", cnt);
  return 0;
}
