#include <iostream>

using namespace std;

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

    return 0;
}
