#include<iostream>
using namespace std;
int n,m,sum1,x,mapn[55][55],visitn[55];
int main(){
cin>>n>>m;
for(int i=1;i<=m;i++){
int a,b;cin>>a>>b;
visitn[a]++,visitn[b]++;
mapn[a][b]=mapn[b][a]=1;}
bool falg=true;
while(1){
falg=true;
for(int i=1;i<=n;i++){
if(visitn[i]==1){
sum1++,x=i,falg=false,visitn[i]--;break;}}
if(falg)break;
for(int i = 1;i<=n;i++){
if(mapn[x][i]==1)
visitn[i]--;}}
cout<<sum1<<endl;}