#include <bits/stdc++.h>
using namespace std;
const int N = 105;
set<int> link[N];
bool vis[N];
int main() {
  int n, m;
  cin >> n >> m;
  int u, v;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    link[u].insert(v);
    link[v].insert(u);
  }
  vector<int> Q;
  int ret = 0;
  while (true) {
    Q.clear();
    int tp = 0, idx;
    for (int i = 1; i <= n; i++) {
      if (!vis[i] && link[i].size() == 1) {
        tp++;
        Q.push_back(i);
        idx = i;
      }
    }
    if (!tp) {
      break;
    }
    ret++;
    for (int i = 0; i < Q.size(); i++) {
      idx = Q[i];
      vis[idx] = true;
      for (set<int>::iterator it = link[idx].begin(); it != link[idx].end();
           it++) {
        int now = *it;
        link[now].erase(link[now].find(idx));
      }
    }
  }
  cout << ret << endl;
}
