#include<iostream>
#include<cstring>
#include<queue>
using namespace std;
#define maxn 100007
#define INF 0x3f3f3f3f
typedef long long ll;
#define IO ios::sync_with_stdio(false);\
    cin.tie(0);\
    cout.tie(0);
int main()
{
    IO;
    ll n,a,b;
    cin>>n>>a>>b;
//    cout<<n<<" "<<a<<" "<<b<<endl;
    if(a>b)
    {
        cout<<"0"<<endl;
    }
    else if(n==1&&a!=b)
    {
        cout<<"0"<<endl;
    }
    else
    {
        ll mm=(n-1)*a+b;
        ll nn=(n-1)*b+a;
//        cout<<mm<<" "<<nn<<endl;
        cout<<nn-mm+1<<endl;
    }
    return 0;
}
