#include<stdio.h>


int main()
{
    int N,A,B;
    scanf("%d%d%d",&N,&A,&B);
    if(N<=1||A>B)
    {
        printf("0\n");
        return 0;
    }
    int ans =  (N-2)*(B-A)+1;
    printf("%d\n",ans);
    return 0;
}
