"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const A = parseInt(arg[0].split(" ")[1]);
    const B = parseInt(arg[0].split(" ")[2]);

    let answer = (N - 2) * (B - A) + 1; 
    
    if(A > B) {
        answer = 0;
    } else if(N === 1) {
        answer = A === B ? 1 : 0;
    }
    
    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));