#include <bits/stdc++.h>
using namespace std;
int N, M;
vector<int> adiac[105];
int ties[105];
queue<int> to_ban;
int main() {
  int rx = 0;
  int a, b;
  scanf("%d %d", &N, &M);
  for (int i = 0; i < M; i++) {
    scanf("%d %d", &a, &b);
    adiac[a].push_back(b);
    adiac[b].push_back(a);
    ties[a]++;
    ties[b]++;
  }
  bool end = 0;
  while (!end) {
    end = 1;
    for (int i = 1; i <= N; i++) {
      if (ties[i] == 1) {
        end = 0;
        to_ban.push(i);
      }
    }
    if (to_ban.size() != 0) rx++;
    while (to_ban.size() != 0) {
      a = to_ban.front();
      to_ban.pop();
      ties[a] = 0;
      for (int i = 0; i < (int)adiac[a].size(); i++) {
        ties[adiac[a][i]]--;
      }
    }
  }
  printf("%d\n", rx);
  return 0;
}
