program main
	implicit none
	integer(8):: X=0,Y,C,N,M,i,j,t,k,D,E
    integer(8),dimension(1:100000):: A,B,NN
    NN=0
	read *, N,M
    do i=1,M
    read *, A(i),B(i)
    NN(A(i))=1
    NN(B(i))=1
    end do
    do i=1,N
    X=X+NN(i)
    end do
    if (N==M+1)then
    write(*,*)N-X
    else
    write(*,*)1
    end if
   
end program main