#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  map<int, int> ss;
  map<int, int>::iterator it;
  map<int, int> mm;
  vector<int> adj[103];
  while (m--) {
    int a, b;
    cin >> a >> b;
    mm[a]++;
    mm[b]++;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  int count = 0;
  for (int i = 0;; i++) {
    int u = 0;
    for (int j = 1; j < 101; j++) {
      if (mm[j] == 1) {
        mm[j]--;
        bool vis[103];
        memset(vis, false, sizeof vis);
        for (int k = 0; k < adj[j].size(); k++) {
          if (!vis[adj[j][k]] && mm[adj[j][k]] != 0) {
            ss[adj[j][k]]++;
            vis[adj[j][k]] = true;
          }
        }
        u = 1;
      }
    }
    for (it = ss.begin(); it != ss.end(); it++) {
      int p = it->first;
      mm[p] -= it->second;
    }
    ss.clear();
    if (u == 0) break;
    count++;
  }
  cout << count << endl;
}
