#include <iostream>
#include <math.h>

using std::cin;
using std::cout;

int main(int argc, char const *argv[])
{
    int n, a, b;
    cin >> n >> a >> b;
    if (a > b || (n == 1 && a != b))
    {
        cout << 0;
        return 0;
    }
    if (n == 1)
    {
        cout << 1;
        return 0;
    }
    int remain = n - 2;
    int sum = remain * (b - a) + 1;
    cout << sum;
    return 0;
}