program sample
    implicit none
  
    integer(8) :: i,j,m,n,a,b
    integer(8),allocatable :: x(:),y(:)
  
    read(*,*) n,a,b
    if(a>b)then
        write(*,*)0
    else if(a==b)then
        write(*,*)1
    else if(n==1 .and. a/=b)then
        write(*,*)0
    else
        write(*,*) (b-a)*(n-2)+1
    end if
  
    stop
end program sample
  

