#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    if(a==b)
    {
        cout<<1<<endl;
    }
    else if(n>1&&a<b)
    {
        cout<<(n-1)*b+a-(n-1)*a-b+1<<endl;
    }
    else
        cout<<0<<endl;
    return 0;

}
