#include <bits/stdc++.h>
using namespace std;
int mat[105][105];
int d[105];
struct node {
  int d;
  int id;
  friend bool operator<(node a, node b) { return a.d > b.d; }
} tt;
queue<int> Q;
int main() {
  int n, m;
  while (scanf("%d %d", &n, &m) != EOF) {
    int i, j;
    int a, b;
    memset(mat, 0, sizeof(mat));
    memset(d, 0, sizeof(d));
    for (i = 0; i < m; ++i) {
      scanf("%d %d", &a, &b);
      mat[a][b] = mat[b][a] = 1;
      d[a]++;
      d[b]++;
    }
    int ans = 0;
    while (1) {
      for (i = 1; i <= n; ++i) {
        if (d[i] == 1) {
          Q.push(i);
        }
      }
      if (Q.empty()) {
        break;
      }
      while (!Q.empty()) {
        j = Q.front();
        d[j]--;
        Q.pop();
        for (i = 1; i <= n; ++i) {
          if (mat[j][i] || mat[i][j]) {
            mat[i][j] = mat[j][i] = 0;
            d[i]--;
          }
        }
      }
      ans++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
