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