#include <bits/stdc++.h>
int DBG = 0;
using namespace std;
const double eps = 1e-9;
const int oo = 1000000000;
const int N = 128;
int n, m;
int adj[N][N], cnt[N];
int main() {
  memset(cnt, 0, sizeof(cnt));
  memset(adj, 0, sizeof(adj));
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    adj[x][y] = adj[y][x] = 1;
    cnt[x]++, cnt[y]++;
  }
  int res = 0;
  while (1) {
    bool ok = false;
    vector<int> blackList;
    for (int i = 1; i <= n; ++i)
      if (cnt[i] == 1) {
        blackList.push_back(i);
        cnt[i] = 0;
        ok = true;
      }
    for (int i = 0; i < int(blackList.size()); ++i) {
      int p = blackList[i];
      for (int j = 1; j <= n; ++j)
        if (cnt[j] && adj[j][p]) cnt[j]--;
    }
    if (ok == false) break;
    res++;
  }
  cout << res << endl;
}
