#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
	int n,max,min;
	cin >> n >> min >> max;
	if(n==1) {
		if(max == min) cout<<1;
		else cout<<0;
		return 0;
	}
	if(min > max) {
		cout<<0;
		return 0;
	}
	int a,b;
	a = (n-1)*min+max;
	b = (n-1)*max+min;
	cout<<b-a+1;
	return 0;
}