#include <bits/stdc++.h>
using namespace std;
void swap(int *x, int *y) {
  int temp = *x;
  *x = *y;
  *y = temp;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int f[10001] = {0};
  vector<int> v[n + 1];
  for (long long i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int flag = 0;
  int groups = 0;
  while (1) {
    vector<int> remo;
    for (int i = 1; i <= n; i++) {
      if (v[i].size() == 1) {
        flag = 1;
        remo.push_back(i);
        v[i].clear();
      }
    }
    if (remo.size() == 0)
      break;
    else
      groups++;
    for (int k = 0; k < remo.size(); k++) {
      int key = remo[k];
      for (int i = 1; i <= n; i++) {
        for (int j = 0; j < v[i].size(); j++) {
          if (v[i][j] == key) v[i].erase(v[i].begin() + j);
        }
      }
    }
  }
  cout << groups << endl;
}
