#include <bits/stdc++.h>
using namespace std;
const long long LINF = (long long)1e18;
const int INF = (int)1e9 + 7;
const int N = (int)501;
const double EPS = (double)1e-9;
const double PI = (double)3.14159265359;
const int MODULO[6] = {INF,        1000019677, 1000019393,
                       1000007521, 1000024073, 1000009667};
const int PF[5] = {77, 31, 98, 45, 67};
const int nx[4] = {0, 0, 1, -1};
const int ny[4] = {1, -1, 0, 0};
const int sz = 500;
inline bool eq(const long double &a, const long double &b) {
  return fabs(a - b) < EPS;
}
long long n, a, b, c;
int main() {
  srand(time(NULL));
  cin >> n >> a >> b >> c;
  if (n >= b) {
    if (a < b - c)
      cout << n / a;
    else {
      long long t = (b - n) / (c - b) + 1;
      cout << t + (n - b * t + c * t) / a;
    }
  } else
    cout << n / a;
  return 0;
}
