#include <bits/stdc++.h>
using namespace std;
vector<int> adj[105];
bool v[105];
int main() {
  int check1 = 0, i, n, m, x, y, kick = 0, j, k;
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  memset(v, 0, 105);
  while (1) {
    check1 = 0;
    for (i = 1; i <= n; i++) {
      if (v[i] != 1) {
        if (adj[i].size() == 1) {
          v[i] = 1;
          check1 = 1;
        }
      }
    }
    for (i = 1; i <= n; i++) {
      if (v[i] == 1) {
        k = adj[i][0];
        for (j = 0; j < adj[k].size(); j++) {
          if (adj[k][j] == i) adj[k].erase(adj[k].begin() + j);
        }
        if (adj[i].size() > 0) adj[i].pop_back();
      }
    }
    if (check1 == 1)
      kick++;
    else
      break;
  }
  cout << kick;
}
