#include using namespace std; using ll=long long; int main(){ ll a,b,n;cin>>a>>b>>n; ll x=1,y=0; ll ans=0; while(n-x>0){ if(x+y>=n){ ans+=b; break; } if((a+b)*y<=b*x){ ans+=a+b; x*=2; y=x/2; } else{ ans+=b; x+=y;; } } cout<