#include <iostream>
#include <cmath>
using namespace std;

int main() {
	long long N, A, B;
	cin >> N >> A >> B;
	if (N == 1 && A != B)	cout << 0;
	else if (A > B) 	cout << 0;
	else {
		cout << (B*(N - 1) + A) - (A*(N - 1) + B) + 1;
	}
	return 0;
}