#include <iostream>
#include <cstdio>
#include <iomanip>
using namespace std;

int main()
{
	long long int n,a,b;
	cin >> n >> a >> b;

	if(a == 0 || b == 0)
		cout << "0";
	else if(a > b)
	{
		cout << "0";
	}
	else if(n == 1 && a == b)
	{
		cout << setiosflags(ios::fixed)<<setprecision(0) << n;
	}
	else if(n == 1 && a != b)
		cout << "0";
	else
	{
		int min = (n - 1) * a + b;
		int max = (n - 1) * b + a;
		cout << setiosflags(ios::fixed)<<setprecision(0) << max - min + 1; 
	}

    return 0;
}