#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,inline,unroll-loops,fast-math")
#pragma GCC optimize("O3")
using namespace std;
using namespace std::chrono;
long long mod_exp(long long x, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = (res * x) % 1000000007;
    x = (x * x) % 1000000007;
    n >>= 1;
  }
  return res;
}
void inout() {
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
}
vector<vector<int>> adj(105);
vector<int> deg(105, 0), del(105, 0), deleted;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < (int)m; ++i) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
    deg[u]++;
    deg[v]++;
  }
  int cnt = 0, flag = 0;
  while (1) {
    for (int i = 1; i <= (int)n; ++i) {
      if (deg[i] == 1) {
        if (del[i] != -1) {
          flag = 1;
          del[i] = -1;
          deleted.push_back(i);
        }
      }
    }
    if (!flag) break;
    for (auto u : deleted) {
      for (auto v : adj[u]) {
        if (del[v] != -1) deg[v]--;
      }
    }
    cnt++;
    deleted.clear();
    flag = 0;
  }
  cout << cnt;
  return 0;
}
