Олимпиадный тренинг

Задача 39059. Guest from the past


Задача

Темы:

Kolya Gerasimov is very fond of kefir, and in his 1984 he mastered all the intricacies of buying this wonderful drink. But one day, as you probably know, he ended up in the distant year 2084, where buying kefir is a more complicated process.

The future is the future, and you always want to eat, so Kolya went to a local dairy shop. In 2084, kefir is sold in liter plastic bottles for  a kopecks apiece and in liter glass bottles for b kopecks apiece. At the same time, you can return an empty glass bottle and get back c (c < b) kopecks, but you cannot return a plastic bottle.

Kolya has  n kopecks in his pocket, and he is very hungry, so he wants to drink as many liters of kefir as possible. Since there were no plastic bottles in his time, he does not know how to act at all. Therefore, he turned to you for help, as to the only acquaintance in the future.


Input
The first line of the input contains a number n (1 <= n <= 1018)— the number of kopecks Kolya has in his pocket.
Lines two through four contain the numbers ab and c (1 <= a < ;= 1018, 1 <= c < b <= 1018) - the cost of a plastic bottle with kefir, the cost of a glass bottle with kefir and how many kopecks can be obtained by turning in an empty glass bottle, respectively.


Imprint
Print a single integer — the maximum number of liters of kefir that Kolya can drink.


Explanations for examples

In the first example Kolya can buy one liter in a glass bottle, then return this bottle and buy a glass bottle again. Thus, he will be able to drink two liters of kefir.
In the second example, Kolya can buy two plastic bottles and get two liters of kefir, or buy first one liter in glass, then return the bottle and buy one bottle in plastic. In both cases, he will buy two liters of kefir.

 
Examples
# Input Output
1 10
11
9
8
2
2 10
5
6
1
2