#include <bits/stdc++.h>
using namespace std;
const int maxx = 110;
int deg[maxx];
vector<pair<int, int> > v;
set<int> adj[maxx];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    deg[a]++, deg[b]++;
    adj[a].insert(b);
    adj[b].insert(a);
  }
  int t = 0;
  for (int k = 0; k < n + 19; k++) {
    v.clear();
    for (int i = 0; i < n; i++) {
      if (adj[i].size() == 1) {
        v.push_back(make_pair(*adj[i].begin(), i));
        adj[i].clear();
      }
    }
    if (!v.size())
      break;
    else {
      t++;
      for (auto x : v) {
        adj[x.first].erase(x.second);
      }
    }
  }
  cout << t << endl;
  return 0;
}
