int main()
{
    float price = 0.0;
    int month = 0;
    int day =0;
    int a =0;
    scanf ("%f %d %d %d",&price,&month,&day,&a);
    if (month == 11&&day == 11)
    {
       price = price * 0.7;
       if (a == 1)
       {
           if (price <= 50)
           {
               price = 0;
           }
           else 
           {
               price -= 50;
           }
       }
    }
    else if (month == 12&&day == 12)
    {
        price = price *0.8;
        if (a == 1)
        {
            if (price <= 50)
            {
                price = 0;
            }
            else 
            {
                price = price - 50;
            }
        }
    }
    else 
    {
        ;
    }
    printf ("%.2f",price);
    return 0;
}s