#include <bits/stdc++.h>
using namespace std;
bool visited[100];
vector<int> temp;
vector<vector<int>> v(101, temp);
int n, m;
int evenOrOdd = 0;
bool check() {
  bool found = 0;
  vector<int> arr;
  for (int i = 1; i <= n; i++) {
    if (v[i].size() < 2 && v[i].size() > 0) {
      found = 1;
      arr.push_back(i);
      v[i] = temp;
    }
  }
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < v[i].size(); j++) {
      if (find(arr.begin(), arr.end(), v[i][j]) != arr.end()) {
        v[i].erase(v[i].begin() + j);
        j--;
      }
    }
  }
  return found;
}
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);
  }
  int cnt = 0;
  while (check()) {
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}
