#include <bits/stdc++.h>
using namespace std;
const int MAX = 105;
int a[MAX * MAX], b[MAX * MAX], deg[MAX];
bool A[MAX];
bool adj[MAX][MAX];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> a[i] >> b[i];
    deg[a[i]]++;
    deg[b[i]]++;
    adj[a[i]][b[i]] = true;
  }
  bool flag = true;
  int ans = 0;
  while (flag) {
    flag = false;
    for (int i = 0; i < m; ++i) {
      if (A[i] == false and (deg[a[i]] == 1 or deg[b[i]] == 1)) {
        A[i] = true;
        adj[a[i]][b[i]] = false;
        flag = true;
      }
    }
    for (int i = 1; i <= n; ++i) deg[i] = 0;
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j)
        if (adj[i][j] == true) {
          deg[i]++, deg[j]++;
        }
    if (flag) ans++;
  }
  cout << ans << endl;
  return 0;
}
