#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = (ll)1e9;
const ll mod = (ll)1e9 + 7;

int main()
{
	int a, b, x;
	cin >> a >> b >> x;

	int ans = 0;
	if (a < 2 * b)
	{
		ans = a * (x / 1000);

		x %= 1000;

		ans += min(a, b * ((500 + x - 1) / 500));
	}
	else
	{
		ans = b * (x / 500);

		x %= 500;
		ans += b * ((500 + x - 1) / 500);
	}

	cout << ans << endl;
}
