#include<iostream>
using namespace std;

int judge(int N, int A, int B) {
    if (A == B) return 1;
    else return (B - A + 1) + (N - 2) * (N - 3);
}

int main() {
    int N, A, B;
    cin >> N >> A >> B;
    
    if (N == 1) {
        if (A != B) { cout << 0 << endl; return 1; }
        else { cout << 1 << endl; return 2;}
    }
    else if (A > B) { cout << 0 << endl; return 3; }
    else cout << judge(N, A, B) << endl;
    
    return 0;
}
