#include <iostream>
#include<bits/stdc++.h>
using namespace std;

int findnum(int n,int a,int b)
{
    if(a==b&&n==1)
    {
        return 1;
    }
    if(b<a||(n==1&&a!=b))
        return 0;
    int sum=a+b;
    int min1=(n-2)*a+sum;
    int max1=(n-2)*b+sum;
    return max1-min1+1;
}
int main()
{
    int N,A,B;
    cin>>N>>A>>B;
    int m=findnum(N,A,B);
    cout<<m<<endl;
    return 0;
}