#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 1e18;
const long double pie = acos((long double)-1);
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
unordered_map<int, vector<int>> mp;
int indegree[1001];
void addedge(int x, int y) {
  mp[x].push_back(y);
  mp[y].push_back(x);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  auto start = std::chrono::high_resolution_clock::now();
  int n, m;
  cin >> n >> m;
  while (m--) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    addedge(x, y);
  }
  int cnt = 0;
  for (auto x : mp) {
    vector<int> v = x.second;
    for (auto y : v) {
      indegree[y]++;
    }
  }
  while (true) {
    int c = 0;
    vector<int> ans;
    for (int i = 0; i < n; ++i) {
      if (indegree[i] == 1) {
        ans.push_back(i);
        indegree[i] = 0;
        c++;
      }
    }
    if (c != 0) {
      cnt++;
    }
    for (auto x : ans) {
      for (auto y : mp[x]) {
        if (indegree[y] > 0) indegree[y]--;
      }
    }
    int flag = 0;
    for (int i = 0; i < n; ++i) {
      if (indegree[i] == 1) {
        flag++;
        break;
      }
    }
    if (flag == 0) {
      break;
    }
  }
  cout << cnt << '\n';
  auto stop = std::chrono::high_resolution_clock::now();
  auto duration =
      std::chrono::duration_cast<std::chrono::nanoseconds>(stop - start);
  return 0;
}
