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