#include <bits/stdc++.h>
using namespace std;
long long Vasos(long long ru, long long lo, long long de) {
  long long a = ((ru - lo) / (lo - de)) + 1;
  return a;
}
int main() {
  long long n, a, b, c;
  while (cin >> n >> a >> b >> c) {
    long long ans = 0, ans2 = 0;
    long long n2 = n;
    if (n >= b) {
      long long aux = Vasos(n, b, c);
      ans = ans + aux;
      long long lo_q = (b * aux) - (c * aux);
      n = n - lo_q;
    }
    ans = ans + (n / a);
    ans2 = (n2 / a);
    n2 = n2 % a;
    if (n2 >= b) {
      long long aux = Vasos(n2, b, c);
      ans2 = ans2 + aux;
      long long lo_q = (b * aux) - (c * aux);
      n2 = n2 - lo_q;
    }
    cout << max(ans, ans2) << endl;
  }
}
