#include <cstdio>


int main()
{
	int n,a,b;
	scanf("%d %d %d",&n,&a,&b);

	if(n == 1)
	{
		if(a == b)
			printf("1");
		else
			printf("0");
	}
	else
	{
		if(a > b)
			printf("0");
		else
		{
			long long int min = (n - 1) * a + b;
			long long int max = (n - 1) * b + a;
			printf("%lld",max - min + 1);
		}

	}

    return 0;
}