#include <bits/stdc++.h>
using namespace std;
template <class T>
string tostring(T x) {
  ostringstream out;
  out << x;
  return out.str();
}
long long toint(string s) {
  istringstream in(s);
  long long x;
  in >> x;
  return x;
}
int t[101];
queue<int> q;
vector<int> v[101];
int n, m, ret;
int main(int argc, char *argv[]) {
  scanf("%d%d", &n, &m);
  while (m--) {
    int a, b;
    scanf("%d%d", &a, &b);
    --a;
    --b;
    t[a]++;
    t[b]++;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 0; i < n; i++) {
    if (t[i] == 1) {
      q.push(i);
      t[i] = 0;
    }
  }
  while (q.size()) {
    int sz = q.size();
    ret++;
    while (sz--) {
      int te = q.front();
      q.pop();
      for (int i = 0; i < v[te].size(); i++) --t[v[te][i]];
    }
    for (int i = 0; i < n; i++)
      if (t[i] == 1) {
        q.push(i);
        t[i]--;
      }
  }
  printf("%d\n", ret);
  return 0;
}
