#include <iostream>
using namespace std;

int main(int argc, char const *argv[])
{
	int n, a, b;

	cin >> n >> a >> b;

	if( (a > b) || (n == 1 && a != b) )
		cout << "0";
	else
		cout << (b - a) * (n - 2) + 1;
	
	return 0;
}