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