#include <bits/stdc++.h>
using namespace std;
const int N = 1e7 + 9, M = 1e3, OO = 0x3f3f3f3f;
inline int readi() {
  int n;
  scanf("%d", &n);
  return n;
}
inline long long readll() {
  long long n;
  scanf("%I64d", &n);
  return n;
}
inline char readc() {
  char c;
  scanf("%c ", &c);
  return c;
}
inline double readd() {
  double n;
  scanf("%lf", &n);
  return n;
}
void IO() {}
int adj[900][900];
int degree[900];
int rmve[900];
int main() {
  IO();
  int n = readi(), m = readi();
  for (int i = 0; i < m; ++i) {
    int u = readi(), v = readi();
    degree[u]++;
    degree[v]++;
    adj[u][v] = 1;
    adj[v][u] = 1;
  }
  int cnt = 0;
  int one = count(degree + 1, degree + n + 1, 1);
  while (one) {
    memset(rmve, 0, sizeof rmve);
    one = count(degree + 1, degree + n + 1, 1);
    bool f = 1;
    for (int i = 1; i <= n; ++i) {
      if (degree[i] == 1) {
        rmve[i]++;
        if (f) {
          cnt++;
          f = 0;
        }
        for (int j = 1; j <= n; ++j) {
          if (degree[j] == 0) continue;
          if (adj[i][j]) rmve[j]++;
        }
      }
    }
    for (int i = 1; i <= n; ++i)
      if (rmve[i]) degree[i] -= rmve[i];
  }
  printf("%d\n", cnt);
  return 0;
}
