#include #include #include #include #include #include #include #include #include #include #include #include #define PI 3.14159265358979323846 #define mod 1000000007 #define pow9 1000000000 #define INF (1 << 30) using namespace std; int main() { long long n, a, b; cin >> n >> a >> b; long long ans1, ans2; if (n % 2 == 0) { ans1 = a * (-(n - 1)); } else { ans1 = a * (-(n - 1)) - b; } ans2 = a * (n - 1) - b * n; cout << min(ans1, ans2) << endl; }