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