module UnionFind
implicit none
integer,allocatable,dimension(:)::par
!parentより

contains
subroutine UFinit(N)
  integer :: N,i
  allocate(par(N))
    do i = 1, N
      par(i) = i
    end do
  end subroutine
  recursive function root(x) result (res)
    integer :: x, res
    if (par(x) == x)then
       res = x
    else
      res = root(par(x))
      par(x) = res
    end if
  end function

subroutine unite(x,y)
integer,intent(in):: x,y
integer xr,yr
xr = root(x)
yr = root(y)
if(xr /= yr) par(xr) = yr
end subroutine

end module UnionFind

use UnionFind
integer N,M
integer,allocatable,dimension(:)::a,b
integer ans,cnt
integer i,j
read*,N,M
allocate(A(M),B(M))
do i=1,M
  read*,A(i),B(i)
end do

ans=0
do i=1,M
  call UFinit(N)
  do j=1,M
    if(i==j)cycle
    call unite(a(j),b(j))
  end do
  cnt=0
  do j=1,N
    if(root(j)==j)cnt=cnt+1
  end do
  if(cnt>=2)then
    ans=ans+1
  endif
  deallocate(par)
end do
print"(i0)",ans
end