#include<iostream>
#include<stirng>
#include<imanip>
using namespace std;
class ticket{
    public:
    static double calculatefinalprice(const sting& tickettype,double baseprice){
        if(baseprice<0){
            return -1.0;
        }
        double discount=0.0;
        if(ticketype=="child"){
            discount=0.20;
        }else if(ticketype=="senior"){
            discount=0.15;
        }else if(ticketype=="student"){
            discount=0.10;
        }
        return  baseprice*(1.0 - discount);
    }
};
int main()
{
    string ticketype;
    double baseprice;
    cin>>tickettype>>baseprice;
    double finalprice=ticketcalculatefinalprice(tickettype,baseprice);
    if(finalprice<0){
        cout<<"Invalid input"<<endl;
    }else{
        cout<<fixed<<setprecision(2)<<finalprice<<endl;
    }
    return 0;
}