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