#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  map<long long int, vector<long long int> > m;
  long long int n, t, cnt = 0, t1, t2;
  cin >> n >> t;
  for (int i = 0; i < t; i++) {
    cin >> t1 >> t2;
    m[t1].push_back(t2);
    m[t2].push_back(t1);
  }
  bool flag = true;
  queue<long long int> q;
  while (flag && m.size() > 1) {
    flag = false;
    map<long long int, vector<long long int> >::iterator it;
    for (it = m.begin(); it != m.end(); it++) {
      t1 = it->first;
      if (m[t1].size() == 1) {
        flag = true;
        t2 = m[t1][0];
        for (int i = 0; i < m[t2].size(); i++) {
          if (m[t2][i] == t1) {
            m[t2][i] = -1;
            q.push(t2);
            break;
          }
        }
        m[t1].clear();
      }
    }
    while (!q.empty()) {
      t2 = q.front();
      for (int i = 0; i < m[t2].size(); i++) {
        if (m[t2][i] == -1) m[t2].erase(m[t2].begin() + i);
      }
      q.pop();
    }
    if (flag) cnt++;
  }
  cout << cnt << endl;
}
