#include <bits/stdc++.h>
using namespace std;
struct bb {
  int a, b;
} l[10000];
vector<int> v[110];
int a[110] = {0};
void up(int x) {
  for (int i = 0; i < v[x].size(); i++) {
    a[l[v[x][i]].a]--;
    a[l[v[x][i]].b]--;
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &l[i].a, &l[i].b);
    a[l[i].a]++;
    a[l[i].b]++;
    v[l[i].a].push_back(i);
    v[l[i].b].push_back(i);
  }
  bool x = 0;
  int Sakura = 0;
  do {
    x = 0;
    vector<int> zz;
    for (int i = 1; i <= n; i++) {
      if (a[i] == 1) {
        x = 1;
        zz.push_back(i);
      }
    }
    for (int j = 0; j < zz.size(); j++) {
      up(zz[j]);
    }
    if (x) Sakura++;
  } while (x);
  printf("%d\n", Sakura);
}
