#include <bits/stdc++.h>
using namespace std;
const long long MOD = 10e9 + 7;
vector<long long> I(100005);
set<long long> gr[105];
vector<bool> visit(101);
vector<long long> parent;
vector<long long> dist;
void dfs(long long x) {
  if (visit[x]) return;
  visit[x] = true;
  for (long long top : gr[x]) {
    dfs(top);
  }
}
void bfs(long long x) {
  visit[x] = true;
  parent[x] = -1;
  dist[x] = 0;
  queue<long long> q;
  q.push(x);
  while (!q.empty()) {
    long long top = q.front();
    q.pop();
    for (long long top1 : gr[top]) {
      if (visit[top1]) return;
      visit[top1] = true;
      parent[top1] = top;
      dist[top1] = dist[top] + 1;
      q.push(top1);
    }
  }
}
int main() {
  long long n, ribs;
  cin >> n >> ribs;
  for (long long i = 0; i < ribs; i++) {
    long long a, b;
    cin >> a >> b;
    gr[a].insert(b);
    gr[b].insert(a);
  }
  bool go = true;
  long long count = 0;
  while (go) {
    go = false;
    vector<long long> clin;
    for (long long i = 1; i <= n; i++) {
      if (gr[i].size() == 1) {
        go = true;
        clin.push_back(i);
      }
    }
    if (!clin.empty()) {
      for (long long top : clin) {
        if (!gr[top].empty()) {
          gr[*gr[top].begin()].erase(top);
          gr[top].clear();
        }
      }
    }
    count++;
  }
  cout << count - 1;
}
