#include <bits/stdc++.h>
using namespace std;
set<int> e[110];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--;
    v--;
    e[u].insert(v);
    e[v].insert(u);
  }
  int res = 0;
  while (1) {
    vector<int> t;
    for (int i = 0; i < n; i++)
      if (e[i].size() == 1) t.push_back(i);
    if (t.empty()) break;
    res++;
    for (int i = 0; i < t.size(); i++) {
      int x = t[i];
      for (set<int>::iterator it = e[x].begin(); it != e[x].end(); ++it)
        e[*it].erase(x);
      e[x].clear();
    }
  }
  printf("%d\n", res);
  return 0;
}
