#include using namespace std; const long long INF = 1000000000000000; vector>> quotient_ranges(int N){ vector>> ans; for (int i = 1; i * i <= N; i++){ ans.push_back(make_pair(N / i, make_pair(i, i))); } for (int i = N / ((int) sqrt(N) + 1); i >= 1; i--){ ans.push_back(make_pair(i, make_pair(N / (i + 1) + 1, N / i))); } return ans; } int main(){ long long A, B; cin >> A >> B; int N; cin >> N; long long ans = INF; for (int i = 1; i <= 30; i++){ int tv = N * 2, fv = -1; while (tv - fv > 1){ int mid = (tv + fv) / 2; int Q = mid / i, r = mid % i; long long pr = 1; bool ok = false; for (int j = 0; j < i; j++){ if (j < r){ pr *= Q + 2; } else { pr *= Q + 1; } if (pr >= N){ ok = true; break; } } if (ok){ tv = mid; } else { fv = mid; } } ans = min(ans, A * i + B * tv); } cout << ans << endl; }