#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;

const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;

#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)

int main() {
	ll A, B, X;
	cin >> A >> B >> X;
	X = (X + 499) / 500 * 500;
	ll ans = 0;
	if (A > B * 2) {
		ans += X / 1000 * 2 * B;
	}else{
		ans += X / 1000 * A;
	}
	if (X % 1000 == 0)
		cout << ans << endl;
	else if (X % 1000 == 500) {
		if (A > B) ans += B;
		else ans += A;
		cout << ans << endl;
	}
	return 0;
}

