#include <iostream>
#include <algorithm>
using namespace std;

int main(){
    int a,b,x;
    cin >> a >> b >> x;
    if(x%500!=0){
        x += 500-x%500;
    }

    if(x<=500){
        cout << min(a,b) << endl;
    }else{
        int twice_b(b*2);
        int ans(0);
        ans += x/1000*min(a,twice_b);
        x -= x/1000*1000;

        ans += x/500*b;

        cout << ans << endl;
    }

    return 0;
}
