#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  return a % b ? gcd(b, a % b) : b;
}
int n, m;
set<int> now;
map<int, set<int> > adj;
int main() {
  int u, v;
  scanf("%d%d", &n, &m);
  for (int(i) = 0; (i) < (int)(n); (i)++) now.insert(i + 1);
  for (int(i) = 0; (i) < (int)(m); (i)++) {
    scanf("%d%d", &u, &v);
    adj[u].insert(v);
    adj[v].insert(u);
  }
  int ans = 0;
  while (1) {
    vector<int> buf;
    for (int i = 1; i <= n; i++) {
      if (now.find(i) != now.end() && adj[i].size() == 1) buf.push_back(i);
    }
    if (buf.size() == 0) break;
    for (int i = 0; i < (int)buf.size(); i++) {
      for (int j = 1; j <= n; j++) {
        if (now.find(j) != now.end()) adj[j].erase(buf[i]);
      }
      now.erase(buf[i]);
    }
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
