#include <iostream>
using namespace std;
int main(void){
   int i,l,x,h;
cin>>i>>l>>x;
  if ( x % 500 != 0 ) x += 500 - x%500;
  int a = 0;
  int b = 0;
h=l*2;
  if ( i < l ) {
    a = x/1000 + ((x%1000>0)?1:0);
  } else if ( i > h ){
    b = x/500;
  } else {
    a = x/1000; 
    b = x%1000/500;
  }

  cout << i*a + l*b << endl;
}

