#include <bits/stdc++.h>
using namespace std;
const long long int linf = (long long)9223372036854775807;
const int dx[8] = {0, 0, 1, -1, 1, -1, 1, -1},
          dy[8] = {1, -1, 0, 0, 1, -1, -1, 1};
const int dKx[8] = {-2, -2, -1, -1, +1, +1, +2, +2},
          dKy[8] = {-1, +1, -2, +2, -2, +2, -1, +1};
const int N = 500;
set<int> g[N];
int cnt;
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 < m; i++) {
    int x, y;
    cin >> x >> y;
    g[x].insert(y);
    g[y].insert(x);
  }
  for (int i = 1; i <= n; i++) {
    vector<int> leafs;
    for (int j = 1; j <= n; j++)
      if (g[j].size() == 1) leafs.push_back(j);
    if (leafs.size()) {
      cnt++;
      for (int j = 1; j <= n; j++) {
        for (auto x : leafs) {
          g[x].clear();
          if (g[j].find(x) != g[j].end()) g[j].erase(g[j].find(x));
        }
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
