405101: GYM101790 K Forbidden messenger

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

K. Forbidden messengertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

A popular messenger will be blocked in X hours. Until this time Nikolay wants to send as many messages as possible to Pavel.

Nikolay writes one message A minutes, after which it is delivered B minutes. Nikolay can start to write a new message immediately after sending the previous one, but he will not send it until the previous one is delivered, even if he has enough time to finish it before.

Determine how many messages Pavel may receive before the messenger is blocked. If some message comes to Pavel at the time of blocking, it will be received successfully.

Input

The first line contains one integer X, denoting the number of hours to the messenger blocking (1 ≤ X ≤ 24).

The second line contains two integers: A is the number of minutes required to write a message, and B is the number of minutes required to deliver a message (1 ≤ A, B ≤ 60).

Output

Print single integer: the maximum number of messages that Pavel may receive.

ExamplesInput
2
10 20
Output
5
Input
3
20 10
Output
8

加入题单

上一题 下一题 算法标签: