#include <bits/stdc++.h>
using namespace std;
long long powmod(long long a, long long b) {
  long long res = 1;
  if (a >= 1000000007) a %= 1000000007;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a;
    if (res >= 1000000007) res %= 1000000007;
    a = a * a;
    if (a >= 1000000007) a %= 1000000007;
  }
  return res;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
vector<int> graph[102];
int D[102];
int n, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  int i;
  for (i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
  for (i = 1; i <= n; i++) {
    D[i] = graph[i].size();
  }
  int j;
  bool flag = true;
  int ans = -1;
  int curentdeg = 1;
  while (flag) {
    flag = false;
    vector<int> T;
    for (j = 1; j <= n; j++) {
      if (D[j] == curentdeg) {
        T.push_back(j);
        flag = true;
      }
    }
    for (int i = 0; i < T.size(); i++) {
      D[T[i]] = 0;
      for (int k = 0; k < graph[T[i]].size(); k++) {
        int x = graph[T[i]][k];
        D[x]--;
      }
      graph[T[i]].clear();
    }
    ans++;
  }
  cout << ans << "\n";
  return 0;
}
