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