#include <iostream>
using namespace std;

int main()
{
    int n,a,b;
    cin >> n >> a >> b;
    if(n==1&&a!=b)
        cout << 0 << endl;
    else if(a>b)
        cout << 0 << endl;
    else
        cout << b*(n-2)-a*(n-2)+1<< endl;
    return 0;
}