#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1E9 + 5;
const long long LINF = (long long)4E18 + 5;
const long double PI = acos(-1.0);
const long double E = 2.718281828459045L;
template <typename T>
T gcd(T a, T b) {
  return (b == 0) ? abs(a) : gcd(b, a % b);
}
template <typename T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
inline T mod(T a, T b) {
  return (a % b + b) % b;
}
template <typename T>
inline T sqr(T x) {
  return x * x;
}
template <typename T>
inline string toString(const T& x) {
  ostringstream os;
  os << x;
  return os.str();
}
inline long long toInt(const string& s) {
  istringstream is(s);
  long long x;
  is >> x;
  return x;
}
inline long double toDouble(const string& s) {
  istringstream is(s);
  long double x;
  is >> x;
  return x;
}
inline string toLower(string s) {
  for (typeof((s).begin()) it = (s).begin(); it != (s).end(); ++it)
    *it = tolower(*it);
  return s;
}
inline string toUpper(string s) {
  for (typeof((s).begin()) it = (s).begin(); it != (s).end(); ++it)
    *it = toupper(*it);
  return s;
}
using namespace std;
int main() {
  int n, m, a, b;
  cin >> n >> m;
  int d[n][n];
  for (int i = 0; i < (n); i++) {
    for (int j = 0; j < (n); j++) {
      d[i][j] = 1;
    }
  }
  for (int i = 0; i < (m); i++) {
    cin >> a >> b;
    d[a - 1][b - 1] = d[b - 1][a - 1] = 0;
  }
  int e, g, f = 0;
  vector<int> v;
  while (1) {
    for (int i = 0; i < (n); i++) {
      e = 0;
      for (int j = 0; j < (n); j++) {
        if (d[i][j] == 0) {
          e++;
          g = i;
        }
      }
      if (e == 1) {
        v.push_back(g);
      }
    }
    if (v.size() == 0) {
      break;
    } else {
      f++;
      for (int i = 0; i < (n); i++) {
        for (int j = 0; j < (n); j++) {
          for (int k = 0; k < (v.size()); k++) {
            if (i == v[k] || j == v[k]) {
              d[i][j] = 1;
            }
          }
        }
      }
      v.clear();
    }
  }
  cout << f;
  return 0;
}
