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

end program main