#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
using vvl = vector<vl>;
const int N = 110;
vl adj[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  while (m--) {
    int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  int res = 0;
  while (1) {
    int cnt = 0;
    vl sub;
    for (int i = 1; i < n + 1; i++) {
      int len = 0;
      for (auto &j : adj[i]) {
        if (j != -1) len++;
      }
      if (len == 1) {
        cnt++;
        sub.push_back(i);
      }
    }
    if (cnt)
      res++;
    else
      break;
    for (auto &node : sub) {
      for (int i = 1; i < n + 1; i++) {
        if (i == node)
          adj[i].clear();
        else {
          for (auto &child : adj[i]) {
            if (child == node) child = -1;
          }
        }
      }
    }
  }
  cout << res;
  return 0;
}
