#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int arr[500][500];
  int siz[500];
  memset(siz, 0, sizeof(siz));
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    siz[a]++;
    siz[b]++;
    arr[a][b] = b;
    arr[b][a] = a;
  }
  int times = 0;
  bool f = false;
  for (int i = 1; i <= n; i++) {
    vector<pair<int, int> > v;
    if (f) times++;
    f = false;
    for (int k = 1; k <= n; k++) {
      int cnt = 0;
      if (siz[k] == 1) {
        int j;
        for (j = 1; j <= n; j++) {
          if (arr[k][j] != 0) break;
        }
        v.push_back(make_pair(k, arr[k][j]));
        siz[k]--;
        f = true;
      }
    }
    for (int k = 0; k < v.size(); k++) {
      siz[v[k].second]--;
      arr[v[k].second][v[k].first] = 0;
    }
  }
  cout << times;
  return 0;
}
