#include <bits/stdc++.h>
using namespace std;
void subtask_1() {
  int w2, w4, k2, k4, x, cost = 0, ans = 0x3f3f3f3f;
  cin >> w2 >> w4;
  cin >> x;
  for (k4 = 0; k4 < x / 4; k4++) {
    k2 = (x - k4 * 4) / 2;
    cost = k2 * w2 + k4 * w4;
    ans = min(ans, cost);
  }
  cout << ans << endl;
}
int main() {
  int x;
  cin >> x;
  switch (x) {
    case 1:
      subtask_1();
      break;
    default:
      break;
  }
  return 0;
}
