#include <bits/stdc++.h>
using namespace std;
vector<int> pi, pi1;
vector<vector<int> > g, g1;
int main() {
  int n = 0, m = 0, k = 0, a, b;
  cin >> n >> m;
  g.assign(n + 1, vector<int>(n + 1));
  pi.assign(n + 1, 0);
  for (int(i) = 0; (i) < (m); ++(i)) {
    cin >> a >> b;
    g[a][b] = 1;
    pi[a]++;
    pi[b]++;
    g[b][a] = 1;
  }
  bool f = true;
  int res = 0;
  g1 = g;
  pi1 = pi;
  while (f) {
    f = false;
    for (int(i) = 0; (i) <= (n); ++(i)) {
      if (pi[i] == 1) {
        f = true;
        pi1[i] -= 1;
        int x = 0;
        for (int(j) = 0; (j) <= (n); ++(j)) {
          if (g[i][j] == 1) {
            g1[i][j] = 0;
            g1[j][i] = 0;
            pi1[j] -= 1;
            break;
          }
        }
      }
    }
    pi = pi1;
    g = g1;
    if (f) res++;
  }
  cout << res << endl;
  return 0;
}
