#include<iostream>
#include<iomanip>
#include<string>
using namespace std;

class Ticket {
private:
    string type;
    double basePrice;
    
public:
    Ticket(string t, double p){
        type = t;
        basePrice = p;
    }
    
    double calculationFinalPrice(){
        if (basePrice < 0)
        return -1;
        
        double discount = 0.0;
        
        if (type == "adult")
        discount = 0.0;
        else if (type == "child")
        discount = 0.20;
        else if(type == "senior")
        discount = 0.15;
        else if (type == "student")
        discount = 0.10;
        else
            discount = 0.0;
            
        return basePrice * (1 - discount);
        }
    };
    
    int main(){
        string ticketType;
        double basePrice;
        
        getline(cin, ticketType);
        cin >> basePrice;
        
        Ticket t(ticketType, basePrice);
        double finalPrice =
        Ticket calculateFinalPrice ();
        
            if (finalPrice < 0)
            cout << "Invalid input";
            else
                cout << fixed << setprecision(2)
        << finalPrice;
        
           return 0;

    }