main_dish = input()
time_of_day = int(input())
has_voucher = input().lower() == 'yes'
is_card_payment = input().lower() == 'yes'
# Determine cost based on main_dish
if main_dish == "paneer tikka":
cost = 250
elif main_dish == "butter chicken":
cost = 240
elif main_dish == "masala dosa":
cost = 200
else:
print("Invalid main dish")
exit() # Exit the program if main dish is invalid
# Apply discounts based on time_of_day
if 12 <= time_of_day <= 15: # Simplified comparison using chained comparison operator
total_cost = (1 - 0.15) * cost # Apply 15% discount for lunch time
else:
total_cost = cost
# Apply voucher discount if has_voucher is True
if has_voucher:
total_cost *= 0.9 # Apply 10% discount if there is a voucher
# Apply service charge for card payments if is_card_payment is True
if is_card_payment:
service_charge = 0.05 * total_cost
total_cost += service_charge # Add service charge to total cost
# Print the total cost formatted to two decimal places
print(f"{total_cost:.2f}")