Kolya Gerasimov loves kefir very much. He lives in year 1984 and knows all the details of buying this delicious drink. One day, as you probably know, he found himself in year 2084, and buying kefir there is much more complicated.

Kolya is hungry, so he went to the nearest milk shop. In 2084 you may buy kefir in a plastic liter bottle, that costs a rubles, or in glass liter bottle, that costs b rubles. Also, you may return empty glass bottle and get c (c < b) rubles back, but you cannot return plastic bottles.

Kolya has n rubles and he is really hungry, so he wants to drink as much kefir as possible. There were no plastic bottles in his 1984, so Kolya doesn't know how to act optimally and asks for your help.


-----Input-----

First line of the input contains a single integer n (1 ≤ n ≤ 10^18) — the number of rubles Kolya has at the beginning.

Then follow three lines containing integers a, b and c (1 ≤ a ≤ 10^18, 1 ≤ c < b ≤ 10^18) — the cost of one plastic liter bottle, the cost of one glass liter bottle and the money one can get back by returning an empty glass bottle, respectively.


-----Output-----

Print the only integer — maximum number of liters of kefir, that Kolya can drink.


-----Examples-----
Input
10
11
9
8

Output
2

Input
10
5
6
1

Output
2



-----Note-----

In the first sample, Kolya can buy one glass bottle, then return it and buy one more glass bottle. Thus he will drink 2 liters of kefir.

In the second sample, Kolya can buy two plastic bottle and get two liters of kefir, or he can buy one liter glass bottle, then return it and buy one plastic bottle. In both cases he will drink two liters of kefir.

Difficulty: interview

Starter code:

Solutions:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
r=n//a
if n > c:
    r=max(r,(r-b+c)//a+1,(n-c)//(b-c)+((n-c)%(b-c)+c)//a)
print(r)

n = int(input())
a = int(input())
b = int(input())
c = int(input())
if(a < (b - c) or n < b):
    print(n // a)
else:
    print((n-b)//(b-c) + 1 + (c + (n-b)%(b-c)) // a)
    


n = int(input())
a = int(input())
b = int(input())
c = int(input())
if a <= b - c or b > n:
    print(n // a)
else:
    ans = (n - c) // (b - c)
    ans += ((n - c) % (b - c) + c) // a
    print(ans)

n = int(input())
a = int(input())
b = int(input())
c = int(input())

cost1 = a
cost2 = b - c

if cost1 <= cost2:
	print(n // cost1)
else:
	r = 0
	if n >= b:
		t = (n - b + 1) // cost2
		r += t
		n -= t * cost2
		if n >= b:
			n -= cost2
			r += 1



	r += n // cost1
	print(r)

import time

n = int(input())
a = int(input())
b = int(input())
c = int(input())

_b = int(b);
b -= c

second = 0
if(n >= _b) :
    second = (n - _b) // b + max(1 + (((n - _b) % b + c) // a), ((n - _b) % b + _b) // a)

print(max(n // a, second))

n = int(input())
a = int(input())
b = int(input())
c = int(input())

cnt1 = n // a
if (n % a >= b):
    cnt1 = cnt1 + 1

cnt2 = 0

k = (n - b) // (b - c)

for mi in range(max(0, k - 10), k + 10, 1):
   if (n - mi * (b - c) >= b):
          cnt2 = mi + 1
          cnt2 = cnt2 + (n - (mi + 1) * (b - c)) // a


print(max(cnt1, cnt2))

n=int(input())
a=int(input())
b=int(input())
c=int(input())

d=b-c

if a<=d:
    print(n//a)

else:
    lb=0
    ub=n
    
    while ub-lb>1 :
        mid=(ub+lb)//2
        tmp=n-d*(mid-1)
        if tmp>=b :
            lb=mid
        else :
            ub=mid
        
    ans=lb
    n-=d*lb
    ans+=n//a
    print(ans)



n = int(input())
a = int(input())
b = int(input())
c = int(input())


if a > (b - c):
	x = ((n - b) // (b - c))
	if x < 0:
		x = n // a
		print(x)
	else:
		n -= (x + 1) * (b - c)
		x += 1
		x += n // a
		print(x)
else:
	x = (n // a)
	print(x)


n = int(input())
a = int(input())
b = int(input())
c = int(input())

l = 0
while n >= a or n >= b:
    if n >= b and b - c < a:
        nl1 = (n - b) // (b - c)
        nl2 = n // b
        nl = max(nl1, nl2)
        l += nl
        n -= (b - c) * nl
    else:
        nl = n // a
        l += nl
        n -= a * nl

print(l)


n = int(input())
a = int(input())
b = int(input())
c = int(input())
if (a <= b - c):
    print(n // a)
    return
otv = n // (b - c)
razn = b - c
razn1 = n - b
if ((razn1 // razn) >= 0):
    otv = razn1 // razn + 1
else:
    otv = 0
otv += (n - otv * (b - c)) // a
print(otv)

n, a, b, c = int(input()), int(input()), int(input()), int(input())
x = (n - c) // (b - c)
if c > n:
	x = 0
y = n - x * (b - c)
x += y // a
print(max(x, n // a))

import collections
import math

def is_prime(x): 
    for i in range(2, math.ceil(math.sqrt(x))):
        if x % i == 0:
            return False
    return True

n = int(input())
a = int(input())
b = int(input())
c = int(input())
ans = 0
if b - c < a:
    if b < n:
        ans += (n - b) // (b - c)
        n = b + (n - b) % (b - c)
    while n >= b:
        ans += n // b
        n = n % b + n // b * c
ans += n // a
print(ans)




n = int(input())
a = int(input())
b = int(input())
c = int(input())

if b > n and a > n:
    print(0)
elif b - c >= a or b > n:
    print(n//a)
else:
    print((n-b)//(b-c) + 1 + (c+(n-b)%(b-c))//a)








n, a, b, c = [int(input()) for _ in range(4)]

# n=ax+

use = max(0, (n - b) // (b - c))
rem = n - use * (b - c)
x = rem // b
ans = max(n // a, use + max(rem // a, x + (rem - x * b + c * x) // a))
print(ans)



n, a, b, c = int(input()), int(input()), int(input()), int(input())
l = 0
if b - c < a and n >= c:
    l = (n - c)//(b - c)
    n -= l*(b - c)
l += n//a
print(l)

n=int(input())
a=int(input())
b=int(input())
c=int(input())
litr =0
cen = b-c
if n>=a or n>=b:
    if cen < a and n>=c:
        litr = (n-c)//(b-c)
        n-=litr*(b-c)
litr += n//a
print(litr)


n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=0
e=-1
if n>=b:
  d=(n-b)//(b-c)
  e=((n-b)%(b-c)+c)//a
print(max(d+e+1,n//a,0))

readInts = lambda: list(map(int, input().split()))

n=int (input())
a=int (input())
b=int (input())
c=int (input())

if a<=b-c or b>n:
    print(n//a)
else:
    tot=n-b
    cost=b-c
    ret=tot//cost+1+(tot%cost+c)//a
    print(ret)






n = int(input())
a = int(input())
b = int(input())
c = int(input())

r = b - c

x = 0
if r < a and b <= n:
    x += (n - b) // r + 1
    n -= r * x
x += n // a
print(x)

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 missingdays <missingdays@missingdays>
#
# Distributed under terms of the MIT license.

"""

"""
def read_list():
    return [int(i) for i in input().split()]
def new_list(n):
    return [0 for i in range(n)]
def new_matrix(n, m=0):
    return [[0 for i in range(m)] for i in range(n)]


n = int(input())

a = int(input())
b = int(input())
c = int(input())

if a < b-c:
    print(n//a)
elif n < b:
    print(n//a)
else:
    diff = b-c

    answ = (n-b)//diff

    n -= answ*b
    n += answ*c

    if n >= b:
        n -= b
        n += c
        answ += 1
    answ += n//a

    print(max(answ, 0))



N = int(input())
a = int(input())
b = int(input())
c = int(input())

solution = 0

if a >= b - c:
    if N >= b:
        solution = (N - b) // (b - c) + 1

    solution += (N - solution * (b - c)) // a
else:
    solution = N // a

print(solution)

def __starting_point():
    r = int(input())
    a = int(input())    #plastic bottle
    b = int(input())    #glass bottl e
    c = int(input())    #return on glass bottle
    d = 0               #drinks
    if b-c>=a:
        d+=r//a
        r =r%a
        #print('a',d,r)
    else:
        if r>=b:
            t = (r - b + 1)//(b-c)
            d += t
            r -= t * (b-c)
            if r >= b:
                r -= (b-c)
                d += 1
        d+=r//a
        
    '''
        while r>=b:
            d+=r//b
            r = r%b + c*(r//b)
            print(d,r)
        if r>=a:    d+=r//a
    '''
    print (d)
'''

A. Guest From the Past
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Kolya Gerasimov loves kefir very much. He lives in year 1984 and knows all the details of buying this delicious drink. One day, as you probably know, he found himself in year 2084, and buying kefir there is much more complicated.

Kolya is hungry, so he went to the nearest milk shop. In 2084 you may buy kefir in a plastic liter bottle, that costs a rubles, or in glass liter bottle, that costs b rubles. Also, you may return empty glass bottle and get c (c < b) rubles back, but you cannot return plastic bottles.

Kolya has n rubles and he is really hungry, so he wants to drink as much kefir as possible. There were no plastic bottles in his 1984, so Kolya doesn't know how to act optimally and asks for your help.
Input

First line of the input contains a single integer n (1 ≤ n ≤ 1018) — the number of rubles Kolya has at the beginning.

Then follow three lines containing integers a, b and c (1 ≤ a ≤ 1018, 1 ≤ c < b ≤ 1018) — the cost of one plastic liter bottle, the cost of one glass liter bottle and the money one can get back by returning an empty glass bottle, respectively.
Output

Print the only integer — maximum number of liters of kefir, that Kolya can drink.
Sample test(s)
Input

10
11
9
8

Output

2

Input

10
5
6
1

Output

2

Note

In the first sample, Kolya can buy one glass bottle, then return it and buy one more glass bottle. Thus he will drink 2 liters of kefir.

In the second sample, Kolya can buy two plastic bottle and get two liters of kefir, or he can buy one liter glass bottle, then return it and buy one plastic bottle. In both cases he will drink two liters of kefir.
'''

__starting_point()

import collections
import math

def is_prime(x): 
    for i in range(2, math.ceil(math.sqrt(x))):
        if x % i == 0:
            return False
    return True

n = int(input())
a = int(input())
b = int(input())
c = int(input())
ans = 0
if b - c < a:
    if b < n:
        ans += (n - b) // (b - c)
        n = b + (n - b) % (b - c)
    if b <= n:
        ans += n // b
        n = n % b + n // b * c
ans += n // a
print(ans)

n = int(input())
a = int(input())
b = int(input())
c = int(input())


res = (n-b)//(b-c)+1
if res >= 0:
    res += ((n-b)%(b-c) + c) // a

if res < n // a:
    res = n // a
print(res)