#include using namespace std; using ll = long long; int main(){ ll n, a, b, c1, c2, ans = 1ll << 60; cin >> n >> a >> b; c1 = n / 2, c2 = n - c1; ans = min(ans, -a * (n - 1) + b * (c2 - c1)); ans = min(ans, -a * (n - 1) + b * (c1 - c2)); ans = min(ans, a * (n - 1) + b * (- n)); for(ll i = 2; i * i <= n; i++){ c1 = n / i, c2 = n - c1; ll d = min(2 * min(c1, c2), n - 1); ans = min(ans, a * (-d + (n - 1 - d)) + b * (c1 - c2)); ans = min(ans, a * (-d + (n - 1 - d)) + b * (c2 - c1)); } cout << ans << endl; }