#include <bits/stdc++.h>
using namespace std;
int n, m, gp, mark[110];
vector<int> v[110];
bool kick[110], b;
vector<int> a;
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    v[--a].push_back(--b);
    v[b].push_back(a);
    mark[a]++;
    mark[b]++;
  }
  for (int i = 0; i < n; i++) {
    b = false;
    for (int j = 0; j < n; j++) {
      if (mark[j] == 1 && kick[j] == false) {
        kick[j] = true;
        b = true;
        a.push_back(j);
      }
    }
    for (int j = 0; j < a.size(); j++) {
      for (int k = 0; k < v[a[j]].size(); k++) mark[v[a[j]][k]]--;
    }
    a.resize(0, 0);
    if (b == true)
      gp++;
    else
      break;
  }
  cout << gp;
  return 0;
}
