#include "iostream" #include "climits" #include "list" #include "queue" #include "stack" #include "set" #include "functional" #include "algorithm" #include "string" #include "map" #include "iomanip" #include "random" using namespace std; const long long int MOD = 1000000007; const long double EPS = 0.00000001; long long int N, M, K, Q, W, H, L, R; long long int ans; int main() { ios::sync_with_stdio(false); cin >> N; cin >> K >> Q; ans = 1000000000; long long int box = 1; long long int bag = 1; for (int i = 1; i < N; i++) { box = 1; long long int c = 0; while (box < N) { bag = box; c += K; for (int j = 0; j < i; j++) { box += bag; c += Q; if (box >= N)break; } if (box >= N)break; ans = min(ans, c + ((N-box)/bag+!!((N-box)%bag))*Q); //cout << ans << endl; } ans = min(ans, c); } cout << ans << endl; return 0; }