#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,a,b;
	cin>>n>>a>>b;
	if(n==1 && (a!=b))
		cout<<"0\n";
	else if(a>b)
		cout<<"0\n";
	else
	{
		long long ans=1ll*(n-1)*b+a;
		long long ans1=1ll*(n-1)*a+b;
		cout<<ans-ans1+1ll<<endl;
	} 
	return 0;
}  