#include using namespace std; void print(vector& v){ for(int i = v.size()-1; 0 <= i; --i) cout << v[i] << " "; cout << endl; } template void chmin(T& a, const T b){a=min(a,b);} int main() { long long A,B,C; cin >> A >> B >> C; if(C==1 || C>=5000){ cout << B*A << endl; return 0; } vector dp(A+1,A*B); dp[0] = 0; for(int i = 0; i < A; ++i){ if(i*C<=A) chmin(dp[i*C],dp[i]+1); for(int j = 1; j < C && i+j <= A; ++j){ chmin(dp[i+j],dp[i]+1); } } cout << dp[A]*B << endl; return 0; }