#include <bits/stdc++.h>
using namespace std;
const double pi = 3.14159265358979323846;
long long pow_mod(long long a, long long b, long long c) {
  if (b == 0) return 1;
  if (b % 2 == 0) {
    long long x = pow_mod(a, b / 2, c);
    return (x * x) % c;
  } else
    return (a % c * pow_mod(a, b - 1, c)) % c;
}
void cp() {}
int n, m;
bool edge[102][102];
int group[102], cnt[102];
void solve() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    edge[x][y] = 1;
    edge[y][x] = 1;
    cnt[x]++;
    cnt[y]++;
  }
  long long ans = 0;
  while (1) {
    int g = 0;
    for (int i = 0; i < n; i++) {
      if (cnt[i] == 1) group[g++] = i, cnt[i] = 0;
    }
    if (!g) break;
    ans++;
    for (int i = 0; i < g; i++) {
      for (int j = 0; j < n; j++) {
        if (edge[group[i]][j] == 1) cnt[j]--;
      }
    }
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long t = 1;
  while (t--) solve();
  return 0;
}
