#include<iostream>
using namespace std;
int main()
{
   int A,B,X;
   cin>>A>>B>>X;
   int P;
   if(A>=2*B)
   {
       P = (X/500)*B;

       if(X%500!=0)
       {
           P += B;
       }
   }
   else
   {
       P = (X/1000)*A;

       if(X%1000!=0)
       {
        if(X%1000<=500 && A>B)
        {
            P += B;
        }
        else
        {
            P += A;
        }
        
       }
   }
   cout<<P<<endl;
   
}
