#include <bits/stdc++.h>
using namespace std;
bool a[101][101];
int main() {
  int n, m;
  cin >> n >> m;
  int x = 0, y = 0;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    a[x][y] = 1;
    a[y][x] = 1;
  }
  bool flag = true;
  int sum = 0, fs = 0;
  ;
  int count = -1;
  vector<int> pos;
  while (flag) {
    count++;
    flag = false;
    pos.clear();
    for (int i = 1; i <= n; i++) {
      sum = 0;
      for (int j = 1; j <= n; j++) {
        sum += a[i][j];
      }
      if (sum == 1) {
        flag = true;
        for (int q = 1; q <= n; q++) {
          if (a[i][q] == 1) {
            pos.push_back(i);
            break;
          }
        }
      }
    }
    for (int i = 0; i < pos.size(); i++)
      for (int q = 1; q <= n; q++) {
        a[q][pos[i]] = 0;
        a[pos[i]][q] = 0;
      }
  }
  cout << count << endl;
  return 0;
}
