A - Tokens Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

問題文

高橋君は N 円持ってゲームセンターに遊びに来ています。 ゲームセンターでは「 X 円払って Y 枚のメダルを買う」ことを好きなだけ( 0 回でも良い)行うことができます。 高橋君が手に入れることのできるメダルの合計枚数の最大値を求めてください。

制約

  • 1 \leq N \leq 10^{12}
  • 1 \leq X, Y \leq 10^{6}
  • N, X, Y は整数

入力

入力は以下の形式で標準入力から与えられる。

N X Y

出力

答えを出力せよ。


入力例 1

12 5 3

出力例 1

6

はじめ、高橋君は 12 円持っています。

  • 5 円払って 3 枚のメダルを買うと、高橋君の所持金は 7 円、メダルの所持枚数は 3 枚になります。
  • さらにもう一度、5 円払って 3 枚のメダルを買うと、高橋君の所持金は 2 円、メダルの所持枚数は 6 枚になります。

結果として高橋君は合計 6 枚のメダルを手に入れることができ、また、これより多くのメダルを手に入れることはできません。 よって、6 を出力します。


入力例 2

4 5 3

出力例 2

0

所持金が 5 円に満たないため、高橋君は 1 枚もメダルを買うことができません。

Problem Statement

Takahashi has come to an amusement arcade with N yen (Japanese currency) in his pocket. In the arcade, he can pay X yen for Y tokens any number of times (possibly zero). Find the maximum total number of tokens that he can get.

Constraints

  • 1 \leq N \leq 10^{12}
  • 1 \leq X, Y \leq 10^{6}
  • N, X, and Y are integers.

Input

The input is given from Standard Input in the following format:

N X Y

Output

Print the answer.


Sample Input 1

12 5 3

Sample Output 1

6

Initially, Takahashi has 12 yen.

  • If he pays 5 yen for 3 tokens, he will have 7 yen and 3 tokens.
  • If he again pays 5 yen for 3 tokens, he will have 2 yen and 6 tokens.

In this way, he can get 6 tokens in total, and there is no way to get more tokens. Thus, 6 should be printed.


Sample Input 2

4 5 3

Sample Output 2

0

Since he has less than 5 yen, he cannot buy any tokens.