#include<iostream>
#include<iomanip>
#include<string>
using namespace std;
int main()
{
    string fueltype;
    float quantity,pricePerLiter;
    cin>>fueltype>>quantity>>pricePerLiter;
    bool validfuel=
    (fueltype == "petrol"||fultype == "diesel");
    bool validValues=
    (quantity>=0&&pricePerLiter>0);
    if(validfuel||validValued)
    {
        cout<<"Invalid input"<<endl;
    }
    else
    {
        float totalcost = quantity * pricePerLiter;
        cout<<fixed <<setprtcision(2)<<totalcost<<endl;
    }
    return 0;
}