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