#include using namespace std; long long N, A, B; int main() { cin >> N >> A >> B; if (2*A < B) { cout << (A-B)*N-A << endl; } else { long long b = N/2; cout << A*(N-4*b-1)-B*(N-2*b) << endl; } }