#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>

using namespace std;

typedef long long ll;

int main()
{
	ll n,a,b;
	scanf("%lld %lld %lld",&n,&a,&b);
	if(n == 1 ){
		if( a == b)
			printf("1");
		else
			printf("0");
	} 
	else{
		if(a > b ) 
			printf("0");
		else
			printf("%lld",(b-a)*(n-2)+1);

	}
	return 0;
}
