#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int main() {
  int n, m, deg[N], res = 0;
  bool visited[N];
  cin >> n >> m;
  vector<vector<int> > g(n + 1);
  queue<int> q;
  for (int i = 1; i <= n; i++) {
    deg[i] = -1;
    visited[i] = false;
  }
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    deg[x]++;
    deg[y]++;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  while (true) {
    bool ok = false;
    for (int i = 1; i <= n; i++)
      if (!deg[i] && !visited[i]) {
        ok = true;
        q.push(i);
        visited[i] = true;
      }
    while (!q.empty()) {
      int x = q.front();
      q.pop();
      for (__typeof((g[x]).begin()) y = (g[x]).begin(); y != (g[x]).end(); y++)
        if (!visited[*y]) deg[*y]--;
    }
    if (ok)
      res++;
    else
      break;
  }
  cout << res;
  return 0;
}
