#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a, b, c;
  cin >> n >> a >> b >> c;
  if (a <= b - c) {
    cout << n / a;
    return 0;
  }
  cout << max(n / a,
              max((n - c) / (b - c) + (n - (n - c) / (b - c) * (b - c)) / a,
                  n / a + (n - n / a * a - c) / (b - c)));
}
