#include <bits/stdc++.h>
using namespace std;
mt19937_64 rang(
    chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
  uniform_int_distribution<int> uid(0, lim - 1);
  return uid(rang);
}
int mpow(int base, int exp);
void ipgraph(int n, int m);
void dfs(int u, int par);
const int mod = 1000000007;
const int N = 1e4, M = N;
vector<int> g[N];
int a[N];
void solve() {
  int n, m;
  cin >> n >> m;
  int grp[n + 1][n + 1];
  memset(grp, 0, sizeof(grp));
  int sums[n + 1];
  memset(sums, 0, sizeof(sums));
  int a, b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    sums[a]++;
    sums[b]++;
    grp[a][b] = 1;
    grp[b][a] = 1;
  }
  int ans = 0;
  int flag = 0;
  while (1) {
    flag = 0;
    vector<int> x;
    for (int i = 1; i <= n; i++) {
      if (sums[i] == 1) {
        flag = 1;
        x.push_back(i);
      }
    }
    if (!flag) {
      break;
    }
    ans++;
    for (auto i : x) {
      if (!sums[i]) {
        continue;
      }
      sums[i]--;
      for (int j = 1; j <= n; j++) {
        if (grp[i][j] == 1) {
          sums[j]--;
          grp[i][j] = 0;
          grp[j][i] = 0;
        }
      }
    }
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((long long)result * base) % mod;
    base = ((long long)base * base) % mod;
    exp >>= 1;
  }
  return result;
}
void ipgraph(int n, int m) {
  int i, u, v;
  while (m--) {
    cin >> u >> v;
    u--, v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
}
void dfs(int u, int par) {
  for (int v : g[u]) {
    if (v == par) continue;
    dfs(v, u);
  }
}
