#include <bits/stdc++.h>
using namespace std;
int n, m;
int lace[110][110];
int main() {
  int x, y, i, j;
  while (cin >> n >> m) {
    memset(lace, 0, sizeof(lace));
    for (i = 1; i <= m; i++) {
      cin >> x >> y;
      lace[x][y] = lace[y][x] = 1;
    }
    int xx, ans = 0;
    while (1) {
      int g[110], num = 0;
      for (i = 1; i <= n; i++) {
        xx = 0;
        for (j = 1; j <= n; j++)
          if (lace[i][j]) xx++;
        if (xx == 1) g[++num] = i;
      }
      for (j = 1; j <= num; j++) {
        for (i = 1; i <= n; i++) lace[g[j]][i] = lace[i][g[j]] = 0;
      }
      if (!num) break;
      ans++;
    }
    cout << ans << endl;
  }
}
