import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;
import std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
void main(){
	long n = read.to!long;
	long a = read.to!long;
	long b = read.to!long;
	
	long ans;
	if(n == 1 && a < b) ans = 0;
	else if(a > b) ans = 0;
	else ans = (a + b * (n -1)) - (a * (n - 1) + b) + 1;
	
	ans.writeln;
	}
