#include <bits/stdc++.h>
using namespace std;
vector<long long> p[110];
void graph(queue<long long> q) {
  while (!q.empty()) {
    long long s = q.front(), z = p[s][0];
    if (p[s].size() > 0) p[s].erase(p[s].begin());
    for (int i = 0; i < p[z].size(); i++)
      if (p[z][i] == s) {
        p[z].erase(p[z].begin() + i);
        break;
      }
    q.pop();
  }
}
int main() {
  long long n, m, a, b, c = 0;
  queue<long long> q;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a >> b;
    p[a].push_back(b);
    p[b].push_back(a);
  }
  for (int j = 1; j <= n; j++) {
    int k = 0;
    for (int i = 1; i <= n; i++) {
      if (p[i].size() == 1) {
        q.push(i);
        k = 1;
      }
    }
    if (k == 0)
      break;
    else {
      graph(q);
      c++;
    }
  }
  cout << c;
}
