+ محدودیت زمان: ۱ ثانیه
+ محدودیت حافظه: ۲۵۶ مگابایت
----------
Tehran municipality has set up a new charging method for the Congestion Charging Zone (CCZ) which controls the passage of vehicles in Tehran’s high-congestion areas in the congestion period (CP) from 6:30 to 19:00. There are plate detection cameras inside or at the entrances of the CCZ recording vehicles seen at the CCZ. The table below summarizes the new charging method.
|The first time seen in the CP | The last time seen in the CP | Charge|
|:----:|:----:|:-----:|
|6:30 to 10:00 | 6:30 to 16:00 | 24000|
|6:30 to 10:00 | 16:01 to 19:00 | 36000|
|10:01 to 16:00 | 10:01 to 16:00 | 16800|
|10:01 to 19:00 | 16:01 to 19:00 | 24000|
Note that the first time and the last time that a vehicle is seen in the CP may be the same. Write a program to compute the amount of charge of a given vehicle in a specific day.
# ورودی
The first line of the input contains a positive integer $n$ ($1 \leq n \leq 100$) where $n$ is the number of records for a vehicle. Each of the next $n$ lines contains a time at which the vehicle is seen. Each time is of form `<hour>:<minute>`, where `<hour>` is an integer number between $0$ and $23$ (inclusive) and `<minute>` is formatted as an exactly two-digit number between $00$
and $59$ (inclusive).
# خروجی
Print the charge to be paid by the owner of the vehicle in the output.
# مثال
## ورودی نمونه ۱
```
4
7:30
2:20
7:30
17:30
```
## خروجی نمونه ۱
```
36000
```
## ورودی نمونه ۲
```
1
12:13
```
## خروجی نمونه ۲
```
16800
```
## ورودی نمونه ۳
```
2
0:30
23:30
```
## خروجی نمونه ۳
```
0
```