#include "iostream"

using namespace std;

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