#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::pair;
using std::stable_sort;
using std::string;
using std::vector;
using namespace std;
bool parent[110][110];
vector<pair<int, int>> parent2(0);
vector<pair<int, int>> vect1(0);
vector<int> vect2(0);
vector<int> vect3(0);
vector<int> vect4(0);
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b = 0;
    cin >> a >> b;
    parent[a][b] = true;
    parent[b][a] = true;
  }
  bool end = false;
  int answer = 0;
  while (!end) {
    vector<int> vect(0);
    end = true;
    for (int i = 1; i <= n; i++) {
      int myi;
      int myj;
      int num = 0;
      for (int j = 1; j <= n; j++) {
        if (parent[i][j]) {
          myi = i;
          myj = j;
          num++;
          if (num > 1) break;
        }
      }
      if (num == 1) {
        parent[myi][myj] = false;
        vect.push_back(myj);
        vect.push_back(myi);
        end = false;
      }
    }
    for (int i = 0; i < vect.size(); i = i + 2) {
      parent[vect[i]][vect[i + 1]] = false;
    }
    if (!end) answer++;
  }
  cout << answer;
  return 0;
}
