// editor5
#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
using namespace std;
class Ticket
{
    private:
    string ticketType;
    double basePrice;
    public:
    Ticket(string type,double price)
    {
        transform(type.begin(),type.end(),type.begin(), ::tolower);
        ticketType=type;
        basePrice=price;
    }
    void calculateFinalPrice()
    {
        double discount=0.0;
        if(ticketType=="adult")
        {
            discount=0.0;
        }
        else if(ticketType=="child")
        {
            discount=0.20;
        }
        else if(ticketType=="senior")
        {
            discount=0.15;
        }
        else if(ticketType=="student")
        {
            discount=0.10;
        }
        else
        {
            cout<<"Invalid input";
            return;
        }
        if(basePrice<-100.00||basePrice>100.00)
        {
            cout<<"Invalid input";
            return;
        }
        double finalPrice=basePrice*(1-discount);
        if(finalPrice<0)
        {
            cout<<"Invalid input"<<e
        }
        if(finalPrice==(int)finalPrice)
        {
            cout<<"Invalid input"<<endl;
        }
        else
        {
            cout<<fixed<<setprecision(2)<<finalPrice<<endl;
        }
    }
        
    };
    int main()
    {
        string ticketType;
        double basePrice;
        getline(cin,ticketType);
        cin>>basePrice;
        
        Ticket ticket(ticketType, basePrice);
        ticket.calculateFinalPrice();
        return 0;
        
    }