#include <bits/stdc++.h>
using namespace std;
long long int GCD(long long int a, long long int b) {
  if (a == 0) {
    return b;
  }
  return GCD(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int q;
  int n, m;
  cin >> n >> m;
  bool ara[n + 1][n + 1];
  for (int i = 1; i < n + 1; i++) {
    for (int j = 1; j < n + 1; j++) {
      ara[i][j] = false;
    }
  }
  int x, y;
  int num[n + 1];
  memset(num, 0, sizeof(num));
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    ara[x][y] = ara[y][x] = true;
    num[x]++;
    num[y]++;
  }
  int loop = 0;
  while (1) {
    int f = 0;
    bool is[n + 1];
    memset(is, false, sizeof(is));
    for (int i = 1; i < n + 1; i++) {
      if (num[i] == 1 && !is[i]) {
        f = 1;
        for (int j = 1; j < n + 1; j++) {
          if (ara[i][j] == true) {
            ara[i][j] = ara[j][i] = false;
            num[j]--;
            num[i]--;
            is[j] = true;
            break;
          }
        }
      }
    }
    if (f == 0) {
      break;
    }
    loop++;
  }
  cout << loop << endl;
}
