#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
bool graph[MAXN][MAXN];
struct field {
  int x, neighbors;
};
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int x, y;
  field arr[n + 1];
  memset(arr, 0, sizeof(arr));
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    graph[x][y] = true;
    graph[y][x] = true;
    arr[x].x = x;
    arr[x].neighbors++;
    arr[y].x = y;
    arr[y].neighbors++;
  }
  bool can = true;
  int ans = 0;
  while (can) {
    vector<int> idx;
    for (int i = 1; i <= n; i++) {
      if (arr[i].neighbors == 1) idx.push_back(i);
    }
    if (idx.size() == 0) break;
    for (int i = 0; i < idx.size(); i++) {
      int k = idx[i];
      arr[k].neighbors--;
      for (int j = 1; j <= n; j++) {
        if (graph[j][k] || graph[k][j]) {
          graph[j][k] = false;
          graph[k][j] = false;
          arr[j].neighbors--;
        }
      }
    }
    ans++;
  }
  cout << ans;
  return 0;
}
