 
 <prompt> James ti wo oko igbimo ti o ni idoti agbara lati 5 PM titi 9 PM. O gba 1 awon wa ni oore. Awo yii ti o to nbe ni $15 ati gbogbo awon wa ti o to nbe ni meji ni owo. Se o ni owo ti o ti ri?

```python
# Python solution
# Calculate the total cost of hiring a horse-drawn carriage

# Define the cost variables
first_hour_cost = 15
additional_hour_cost = 2 * first_hour_cost

# Calculate the total cost
total_cost = first_hour_cost + 3 * additional_hour_cost

print("James paid: $", total_cost)
``` <response>: def solution():
    """James hires a horse-drawn carriage from 5 PM to 9 PM.  He gets 1 hour free.  The first paid hour is $15 and each hour after that is twice the cost.  How much did he pay?"""
    end_time = 9
    start_time = 5
    time_in_hours = end_time - start_time
    free_hours = 1
    paid_hours = time_in_hours - free_hours
    hours_after_first = paid_hours - 1
    first_hour_cost = 15
    cost_after_first_hour = hours_after_first * first_hour_cost * 2
    total_cost = first_hour_cost + cost_after_first_hour
    result = total_cost
    return result 