#include<cstdio>
#include<algorithm>
using namespace std;
long long n,a,b,ans;
int main(){
	scanf("%lld%lld%lld",&n,&a,&b);
	if((b<a)||(n==1&&a!=b))putchar('0');
	else printf("%lld",max(0ll,(n-2)*(b-a)+1));
}