#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void checkmin(T& a, const T& b) {
  if (a > b) a = b;
}
template <typename T>
inline void checkmax(T& a, const T& b) {
  if (a < b) a = b;
}
int g[101][101];
int deg[101];
int par[101];
int main() {
  int n, m;
  while (cin >> n >> m) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) g[i][j] = 0;
      deg[i] = 0;
    }
    for (int k = 1; k <= m; k++) {
      int a, b;
      scanf("%d%d", &a, &b);
      g[a][b] = g[b][a] = 1;
      ++deg[a];
      ++deg[b];
    }
    int res = 0;
    for (;;) {
      int flag = 0;
      for (int i = 1; i <= n; i++) {
        if (deg[i] == 1) {
          for (int j = 1; j <= n; j++) {
            if (g[i][j]) {
              par[i] = j;
              flag = 1;
              break;
            }
          }
        } else {
          par[i] = -1;
        }
      }
      if (flag == 0) break;
      for (int i = 1; i <= n; i++) {
        if (par[i] != -1 && g[i][par[i]]) {
          g[i][par[i]] = 0;
          g[par[i]][i] = 0;
          --deg[i];
          --deg[par[i]];
        }
      }
      ++res;
    }
    cout << res << endl;
  }
}
