#include using namespace std; constexpr long long inf = 1001001001001001001; int main() { long long a,b,n; cin >> a >> b >> n; if(n == 1) { cout << 0 << endl; return 0; } long long ans = inf; for(int i = 1; i <= 30; i++) { ans = min(ans,(a+b)*i+max(0ll,n-(1 << i)+(1 << (i-1))-1)/(1 << (i-1))*b); } cout << ans << endl; }