#include <bits/stdc++.h>
using namespace std;
int color[110];
int main() {
  int n, m, i, u, v, g, j;
  cin >> n >> m;
  vector<vector<int> > adj(n + 2);
  for (i = 0; i < m; i++) {
    cin >> u >> v;
    adj[u - 1].push_back(v - 1);
    adj[v - 1].push_back(u - 1);
  }
  int c = 0;
  while (1) {
    int flag = 0;
    for (i = 0; i < n; i++) {
      if (adj[i].size() == 1) {
        flag = 1;
      }
    }
    if (flag == 0) {
      break;
    } else {
      memset(color, 0, sizeof(color));
      for (i = 0; i < n; i++) {
        if (adj[i].size() == 1) {
          color[i] = 1;
        }
      }
      for (i = 0; i < n; i++) {
        if (color[i] == 1) {
          g = adj[i][0];
          for (j = 0; j < adj[g].size(); j++) {
            if (adj[g][j] == i) {
              adj[g].erase(adj[g].begin() + j);
              break;
            }
          }
          adj[i].pop_back();
        }
      }
    }
    c++;
  }
  cout << c << endl;
  return 0;
}
