#include<iostream>
#include<cmath>
using namespace std;
#define MOD 1000000007
typedef long long ll;
ll sum = 0;
int prime[11000]; 
int main(){
	int n , a , b; cin >> n >> a >> b;
	if(n == 1){
		if(a == b) cout << 1;
		else cout << 0;
		return 0;
	}else if( a > b){
		cout << 0;
		return 0;
	}
	cout << (b - a)* (n-2) + 1;
	return 0;
}