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