#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

int n, a, b;

int main() {
    scanf("%d %d %d", &n, &a, &b);
    if(n == 1)
    {
        if(a == b)
        {
            printf("1\n");
        }
        else
        {
            printf("0\n");
        }
    }
    else
    {
        printf("%d\n", (n - 2) * (b - a) + 1);
    }
    return 0;
}