#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592654;
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
void fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
}
int main() {
  fast();
  int n, m, c = 0, sol = 0;
  cin >> n >> m;
  map<int, set<int>> mp;
  vector<bool> vis(n + 1);
  map<int, bool> del;
  for (int(i) = 0; (i) < (long long)(m); (i)++) {
    int a, b;
    cin >> a >> b;
    mp[a].insert(b);
    mp[b].insert(a);
  }
  vector<int> v;
  vector<int>::iterator it;
  while (true) {
    bool test = 0;
    for (auto e : mp) {
      if (e.second.size() == 1 && !vis[e.first]) {
        test = 1;
        v.push_back(e.first);
        vis[e.first] = 1;
        del[e.first] = 1;
      }
    }
    if (v.size()) {
      for (auto &e : mp) {
        if (del[e.first]) continue;
        for (int i = 0; i < v.size(); i++) {
          if (binary_search((e.second).begin(), (e.second).end(), v[i])) {
            e.second.erase(v[i]);
          }
        }
      }
    }
    if (test)
      c++;
    else
      break;
  }
  cout << c << endl;
  return 0;
}
