#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ll n, a, b;
    cin >> n >> a >> b;
    ll res;
    if (a > b || (n == 1 && a != b))
        cout << 0;
    else
    {
        ll l = n*a+(b-a);
        ll r = n*b-(b-a);
        res = r-l+1;
        cout<<res;
    }
}