// editor5
#include <iostream>
using namespace std;
 class ticket{
     private:
     string type;
     double price;
     public:
     ticket(string t, double p)
     {
         type = t;
         price = p;
     }
     void calprice()
     {
         if(price < 0)
         {
             cout<<"Invalid input";
             return;
         }
         double discount = 0;
         if(type =="adult" || type == "Adult")
         {
             discount=0;
         }
         else if(type ="child" || type == "Child")
         {
             discount=0.20;
         }
         else if(type = "senior" || type== "Senior")
         {
             discount=0.15;
         }
         else if(type ="student" || type = "Student")
         {
             discount = 0.10;
         }
         double fin=price-(price*discount);
         cout<<fin;
     }
     
 };
 int main()
 {
     string type;
     double price;
     getline(cin,type);
     cin>>price;
     ticket t(type,price);
     t.calprice();
 }