#include <iostream>
using namespace std;

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