#include <bits/stdc++.h>
using namespace std;
const int dr[] = {-1, 1, 0, 0};
const int dc[] = {0, 0, -1, 1};
const int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
const int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int kr[] = {1, 1, -1, -1, 2, 2, -2, -2};
const int kc[] = {2, -2, 2, -2, 1, -1, 1, -1};
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
const int res = 100 + 5;
const int res1 = 1e4 + 5;
int nodes, edges, A[res1], B[res1], degree[res];
bool seen[res];
int main() {
  scanf("%d %d", &nodes, &edges);
  for (int i = 0; i < edges; i++) {
    scanf("%d %d", &A[i], &B[i]);
    A[i]--;
    B[i]--;
  }
  int ans = 0;
  while (true) {
    memset(degree, 0, sizeof(degree));
    for (int i = 0; i < edges; i++) {
      if (seen[A[i]]) {
        continue;
      }
      if (seen[B[i]]) {
        continue;
      }
      degree[A[i]]++;
      degree[B[i]]++;
    }
    bool flag = false;
    for (int i = 0; i < nodes; i++) {
      if (degree[i] == 1) {
        flag = true;
        seen[i] = true;
      }
    }
    if (!flag) {
      break;
    }
    ans++;
  }
  deb(ans);
}
