#include <stdio.h>
#include <stdlib.h>



int main()
{
    int n;
    long int a,b;
    long int s,s1,s2;
    scanf("%d %ld %ld",&n,&a,&b);
    if(a>b||n<1||(n==1&&a!=b)||a>1000000000||b>1000000000)
        printf("0");
    else
    {
        s1=a*(n-1)+b;
        s2=a+(n-1)*b;
        s=s2-s1+1;
        printf("%ld",s);
    }

    return 0;
}
