#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
long long int powmod(long long int a, long long int b) {
  long long int res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
vector<int> g[1000];
int deg[111];
queue<int> q;
bool mk[111];
int main() {
  int t = 1;
  while (t--) {
    int n, m, u, v;
    cin >> n >> m;
    for (int i = (0); i < (m); i++) {
      cin >> u >> v;
      g[u].push_back(v);
      g[v].push_back(u);
      deg[u]++;
      deg[v]++;
    }
    int c = 0;
    memset(mk, 0, sizeof(mk));
    while (1) {
      for (int i = (0); i < (n + 1); i++) {
        if (!mk[i] && deg[i] == 1) q.push(i);
      }
      if (q.empty()) break;
      c++;
      while (!q.empty()) {
        int v = q.front();
        q.pop();
        mk[v] = true;
        for (int j = (0); j < (g[v].size()); j++) {
          int w = g[v][j];
          if (mk[w]) continue;
          deg[w]--;
        }
      }
    }
    cout << c << endl;
  }
  return 0;
}
