#include <bits/stdc++.h>
using namespace std;
int a[101][101], deg[101], vis[101], N, M;
int main() {
  while (scanf("%d%d", &N, &M) == 2) {
    memset(a, 0, sizeof(a));
    memset(deg, 0, sizeof(deg));
    for (int i = 1; i <= M; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      a[u][v] = a[v][u] = 1;
      deg[v]++;
      deg[u]++;
    }
    int ans = 0;
    while (1) {
      int flag = 0;
      memset(vis, 0, sizeof(vis));
      for (int i = 1; i <= N; i++)
        if (deg[i] == 1) vis[i] = 1;
      for (int i = 1; i <= N; i++)
        if (vis[i]) {
          for (int j = 1; j <= N; j++)
            if (a[i][j]) {
              deg[j]--;
              deg[i] = 0;
              flag = 1;
            }
        }
      if (!flag) break;
      ans++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
