#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
class ticket{
    public:
    static double calculatefinalprice(const string& ticketype,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>>ticketype>>baseprice;
    double finalprice=calculatefinalprice(ticketype,baseprice);
    if(finalprice<0){
        cout<<"Invalid input"<<endl;
    }else{
        cout<<fixed<<setprecision(2)<<finalprice;
    }
    return 0;
}