#include <bits/stdc++.h>
using namespace std;
int read() {
  int num = 0;
  bool f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    f = (ch == '-');
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    num = (num << 1) + (num << 3) + ch - '0';
    ch = getchar();
  }
  return f ? -num : num;
}
int n, m;
int deg[111];
vector<int> vec[111];
int topsort() {
  int res = 0, fl = 1;
  queue<int> Q;
  while (fl) {
    fl = 0;
    for (int i = 1; i <= n; i++)
      if (deg[i] == 1) Q.push(i), fl = 1;
    while (!Q.empty()) {
      int u = Q.front();
      Q.pop();
      deg[u]--;
      for (int v : vec[u]) deg[v]--;
    }
    if (fl) res++;
  }
  return res;
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= m; i++) {
    int x = read(), y = read();
    deg[x]++, deg[y]++;
    vec[x].push_back(y);
    vec[y].push_back(x);
  }
  printf("%d\n", topsort());
  return 0;
}
