#include <bits/stdc++.h>
using namespace std;
const char nl = '\n';
const int N = 105;
int n, e;
vector<int> v[N];
void solve() {
  cin >> n >> e;
  for (int i = 0; i < e; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int inc[N] = {0};
  for (int i = 1; i <= n; i++) inc[i] = v[i].size();
  int c = 0;
  while (1) {
    vector<int> grp;
    for (int i = 1; i <= n; i++) {
      if (inc[i] == 1) {
        grp.push_back(i);
        inc[i] = 0;
      }
    }
    if (grp.size() > 0) {
      c++;
      for (int i : grp) {
        for (int j = 0; j < v[i].size(); j++) inc[v[i][j]]--;
      }
    } else {
      cout << c << nl;
      return;
    }
  }
}
int32_t main() {
  int t = 1;
  while (t--) solve();
}
