#include <iostream>
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

using namespace std;
int main(int argc, char** argv) {
	
	int n,a,b;
	scanf("%d%d%d",&n,&a,&b);
	
	if(a>b || (n==1 && a!=b)) 
	printf("0");
	else if(n==1 && a==b)
	printf("1");
	else 
	{
		printf("%d",(b-a)*(n-2)+1);
	}
	
	return 0;
}