#include <bits/stdc++.h>
using namespace std;
char en = '\n';
long long int inf = pow(10, 14);
long long int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  map<long long int, long long int> adj[105];
  for (long long int i = 1; i < m + 1; i += 1) {
    long long int a, b;
    cin >> a >> b;
    adj[a][b];
    adj[b][a];
  }
  long long int cnt = 0;
  while (1) {
    vector<long long int> put;
    for (long long int i = 1; i < n + 1; i += 1) {
      if (adj[i].size() == 1) {
        put.push_back(i);
      }
    }
    if (put.size() == 0) break;
    cnt++;
    for (long long int x : put) {
      adj[x].clear();
      for (long long int i = 1; i < n + 1; i += 1) adj[i].erase(x);
    }
  }
  cout << cnt << endl;
  return 0;
}
