#include <bits/stdc++.h>
using namespace std;
const int inf = (int)(1e9);
const int mod = inf + 7;
const double pi = acos(-1.0);
const double eps = 1e-9;
int n, m;
vector<int> g[100100];
vector<int> del;
bool used[100100];
int main() {
  cin >> n >> m;
  for (int i = 0, x, y; i < m; i++) {
    cin >> x >> y;
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  int ans = 0;
  while (1) {
    del.clear();
    memset(used, 0, sizeof used);
    for (int i = 0; i < n; i++)
      if (g[i].size() == 1) {
        del.push_back(i);
        used[i] = 1;
      }
    if (del.size() == 0) break;
    for (int i = 0; i < del.size(); i++) g[del[i]].clear();
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < g[i].size();) {
        if (used[g[i][j]]) {
          g[i].erase(g[i].begin() + j);
        } else
          j++;
      }
    }
    ans++;
  }
  cout << ans;
  return 0;
}
