#include <bits/stdc++.h>
using namespace std;
void ga(int N, int *A) {
  for (int i(0); i < N; i++) scanf("%d", A + i);
}
long long N, A[(1 << 17)], d, a, b, c, B, H, f;
long long pc(long long M) { return M / a; }
int main(void) {
  scanf("%lld%lld%lld%lld", &N, &a, &b, &c);
  B = pc(N);
  if (N >= b) {
    H = N - b;
    f = H / (b - c);
    H = b + (H % (b - c));
    B = max(B, f + pc(H));
    while (H >= b) {
      H -= (b - c);
      ++f;
      B = max(B, f + pc(H));
    }
    B = max(B, f + pc(H));
  }
  printf("%lld\n", B);
  return 0;
}
