#include <iostream>
using namespace std;
int main()
{
		long long n,a,b;
		cin >> n >> a >> b;
		if (a > b)
		{
				cout <<0;
				exit(0);
		}
		if (n == 1 && a != b)
		{
				cout <<0;
				exit(0);
		}
		if (n <= 2)
		{
				cout <<1;
				exit(0);
		}
		cout <<(n-2)*b - (n-2)*a + 1;
}
