Monocarp saved up $$$n$$$ burles and decided to deposit all his $$$n$$$ burles in a local bank.
Unfortunately, Monokarp hasn't read the license agreement, that's why now he has only two types of operations with money in the deposit (fortunately, he can make any number of operations of each type):
Assume that Monocarp put all his $$$n$$$ burles in the bank account and he has no more money left, so he can work only with money he put in the bank.
Calculate the maximum possible amount of burles Monocarp can obtain from his bank account using only described operations.
The first line contains three integers $$$n$$$, $$$a$$$, and $$$b$$$ ($$$1 \le a, b \le n \le 10^{6}$$$) — the number of burles Monocarp deposited initially, the number of burles he can withdraw from the account in one operation, and the number of burles he can deposit to the account in one operation.
Print the maximum possible amount of burles Monocarp can obtain from his bank account using only operations described in the statement.
17 5 3
17
97 10 6
96
77141 21540 3108
77136
| Name |
|---|


