main = function(input) {
    var data = input.split("\n").join(" ").split(" ");
    var n = parseInt(data[0]);
    var a = parseInt(data[1]);
    var b = parseInt(data[2]);
    
    var ans = 0;
    
    if(n == 1){
        if(a == b)
            ans = 1;
        else
           ans = 0;
    }else if(n > 1){
         if(a > b)
             ans = 0;
        else{
            ans = (b - a)*(n - 2) + 1;
        }
    }
    
    ans = parseInt(ans);
    
    console.log(Math.max(parseInt(ans), parseInt(0)));
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));