#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
vector<int> comp;
vector<int> g[N];
bool used[N];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--, y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  int iter = 0;
  while (1) {
    vector<int> group;
    for (int i = 0; i < n; i++) {
      if (g[i].size() == 1) {
        group.push_back(i);
      }
    }
    if (group.empty()) break;
    for (int i = 0; i < group.size(); i++) {
      for (int j = 0; j < g[group[i]].size(); j++) {
        for (int k = 0; k < g[g[group[i]][j]].size(); k++) {
          if (g[g[group[i]][j]][k] == group[i]) {
            g[g[group[i]][j]].erase(g[g[group[i]][j]].begin() + k);
            break;
          }
        }
      }
      g[group[i]].clear();
    }
    ++iter;
  }
  cout << iter << endl;
  return 0;
}
