#include <bits/stdc++.h>
using namespace std;
const long long nInf = -1000000000;
const long long pInf = 1000000000;
const long long mod = 1000000007;
const int MAXN = 1000;
void getdata();
void preproc();
void solve();
int n, m;
vector<int> g[MAXN];
int count1 = 0;
bool used[MAXN];
int del[MAXN];
void dfs(int v, int num);
int main() {
  int t = 1;
  for (int i = 0; i < t; i++) {
    getdata();
    preproc();
    solve();
  }
  return 0;
}
void getdata() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
}
void preproc() {}
void solve() {
  bool b = true;
  fill(del, del + MAXN, -1);
  int num = 0;
  while (b) {
    count1 = 0;
    fill(used, used + MAXN, 0);
    for (int i = 0; i < n; i++) {
      if (!used[i] && del[i] == -1) dfs(i, num);
    }
    if (count1 == 0) {
      printf("%d\n", num);
      break;
    }
    num++;
  }
}
void dfs(int v, int num) {
  used[v] = true;
  int c1 = 0;
  for (int i = 0; i < (int)g[v].size(); i++) {
    int to = g[v][i];
    if (!used[to] && (del[to] == num || del[to] == -1)) {
      dfs(to, num);
    }
    if (del[to] == num || del[to] == -1) {
      c1++;
    }
  }
  if (c1 == 1) {
    count1++;
    del[v] = num;
  }
}
