#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int lcm(int a, int b) { return (a * b) / gcd(a, b); }
int power(int x, int y, int m) {
  if (y == 0) return 1;
  int p = power(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
int modi(int a, int m) {
  int m0 = m;
  int y = 0, x = 1;
  if (m == 1) return 0;
  while (a > 1) {
    int q = a / m;
    int t = m;
    m = a % m, a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += m0;
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, i, j, k;
  cin >> n >> m;
  int adj[n + 10][n + 10], degree[n + 10];
  for (i = 1; i <= n; i++) {
    degree[i] = 0;
    for (j = 1; j <= n; j++) {
      adj[i][j] = 0;
    }
  }
  while (m--) {
    int x, y;
    cin >> x >> y;
    adj[y][x] = 1;
    adj[x][y] = 1;
    degree[x]++;
    degree[y]++;
  }
  int count = 0;
  while (1) {
    int flag = 0;
    int delet[n + 10];
    for (i = 1; i <= n; i++) delet[i] = 0;
    for (i = 1; i <= n; i++) {
      if (degree[i] == 1) {
        delet[i] = 1;
        flag = 1;
      }
    }
    if (flag == 0) break;
    count++;
    for (i = 1; i <= n; i++) {
      if (delet[i] == 1) {
        degree[i]--;
        for (j = 1; j <= n; j++) {
          if (adj[i][j] == 1) {
            adj[i][j] = 0;
            adj[j][i] = 0;
            degree[j]--;
          }
        }
      }
    }
  }
  cout << count;
  return 0;
}
