#include <bits/stdc++.h>
using namespace std;
template <class T>
bool ckmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
void read(vector<long long int> &a, int n) {
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
}
bool fine = 0;
vector<long long int> a, b;
long long int n, m, k, x, y, p, q;
long long int d;
const int N = 105;
set<long long int> adj[N];
void solve() {
  long long int ans = 0;
  cin >> n >> m;
  while (m--) {
    int u, v;
    cin >> u >> v;
    adj[u].insert(v);
    adj[v].insert(u);
  }
  queue<int> q;
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() == 1) q.push(i);
  }
  if (q.size() == 0) {
    cout << 0 << "\n";
    return;
  }
  while (true) {
    queue<int> temp;
    temp = q;
    if (temp.size() == 0) break;
    ++ans;
    while (q.size()) q.pop();
    while (temp.size()) {
      int u = temp.front();
      temp.pop();
      int v = *adj[u].begin();
      adj[v].erase(u);
      adj[u].erase(v);
    }
    for (int i = 1; i <= n; i++)
      if (adj[i].size() == 1) q.push(i);
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  if (fine) {
    int t;
    cin >> t;
    while (t--) {
      solve();
    }
  } else
    solve();
  return 0;
}
