program AGC015A
    implicit none
    integer(8)::N,A,B
    read*,N,A,B
    if((N==1.and.A/=B).or.A>B)then
        print'(i0)',0
    else
        print'(i0)',B*(N-1)+A-(B+A*(N-1))+1
    end if
end program AGC015A