#include <bits/stdc++.h>
using namespace std;
long long n, a, b, c;
long long d;
long long cnt1, cnt2;
long long r;
int main() {
  cin >> n >> a >> b >> c;
  d = b - c;
  if (n >= a) {
    cnt1 = n / a;
    r = n % a;
    if (r >= b) cnt1 += (r - b) / d + 1;
  }
  if (n >= b) {
    r = n - b;
    long long cnt = r / d + 1;
    cnt2 += cnt;
    cnt2 += (n - cnt * d) / a;
  }
  printf("%lld\n", max(cnt1, cnt2));
  return 0;
}
