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



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

    return 0;
}
