#include <bits/stdc++.h>
using namespace std;
using ll = long long;
long double PI = 3.141592653589793238463;
const int N = 2e5 + 5;
ll mod = 2e5 + 5;
int n, m, x, y;
vector<vector<int> > adj(101);
int vs[101];
map<int, int> mp;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  int mn = 10000;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
    mp[x]++;
    mp[y]++;
  }
  for (auto i : mp) mn = min(mn, i.second);
  int cnt = 0;
  while (mn == 1) {
    multiset<int> s;
    for (int k = 1; k <= n; k++) {
      if (mp[k] == 0) continue;
      if (mp[k] == 1) {
        mp[k] = 0;
        for (int i = 0; i < adj[k].size(); i++) {
          int y = adj[k][i];
          if (mp[y] > 0) s.insert(y);
        }
      }
    }
    cnt++;
    mn = 1000;
    for (auto i : s) {
      mp[i]--;
    }
    for (auto i : mp)
      if (i.second == 1) mn = 1;
  }
  cout << cnt;
}
