#include <bits/stdc++.h>
using namespace std;
const int MAX = 110;
int main() {
  int n, m;
  cin >> n >> m;
  int matrix[MAX][MAX];
  int degree[MAX];
  for (int i = 1; i <= n; i++) {
    degree[i] = 0;
    matrix[i][i] = 0;
    for (int j = i + 1; j <= n; j++) {
      matrix[i][j] = 0;
    }
  }
  int x, y;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    matrix[x][y] = 1;
    matrix[y][x] = 1;
    degree[x]++;
    degree[y]++;
  }
  int count = 0;
  int remain = n;
  stack<int> s;
  while (1) {
    for (int i = 1; i <= n; i++) {
      if (degree[i] == 1) {
        s.push(i);
        degree[i]--;
      }
    }
    if (s.empty()) break;
    int x;
    while (!s.empty()) {
      x = s.top();
      s.pop();
      for (int y = 1; y <= n; y++) {
        if (matrix[x][y] == 1) {
          degree[y]--;
          matrix[x][y] = 0;
          matrix[y][x] = 0;
        }
      }
    }
    ++count;
  }
  cout << count;
  return 0;
}
