#include<iostream>
using namespace std;
int main(){
    int a,b,x;
    cin >> a >> b >> x;
    int ans=0;
    if(a>=2*b){
        ans=x/500*b;
        if(x%500!=0){
            ans+=b;
        }
    }else{
        ans=x/1000*a;
        if(x%1000!=0){
            if(a>b&&x%1000<=500){
                ans+=b;
            }else{
                ans+=a;
            }
        }
    }
    cout << ans << endl;
}
