#include <bits/stdc++.h>
using namespace std;
int pup[110];
int tabl[101][101];
int main() {
  int n, m, a, b, i, j, grup, flag;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> a >> b;
    pup[a]++;
    pup[b]++;
    tabl[a][b] = 1;
    tabl[b][a] = 1;
  }
  grup = 0;
  flag = 1;
  while (flag == 1) {
    flag = 0;
    for (i = 1; i <= n; i++) {
      if (pup[i] == 1) {
        pup[i]--;
        flag = 1;
        for (j = 1; j <= n; j++)
          if (tabl[i][j]) {
            tabl[i][j] = 0;
            tabl[j][i] = 0;
            if (pup[j] == 2)
              pup[j] = 1001;
            else
              pup[j]--;
          }
      }
    }
    if (flag) grup++;
    for (i = 1; i <= n; i++)
      if (pup[i] == 1001)
        pup[i] = 1;
      else if (pup[i] == 1000)
        pup[i] = 0;
  }
  cout << grup << endl;
  return 0;
}
