#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    long long int n, a, b, c;
    cin >> n;
    cin >> a;
    cin >> b;
    cin >> c;
    long long int d;
    d = min(a, b - c);
    if (d == a)
      cout << n / a;
    else if (n >= b) {
      d = ((n - b) / (b - c));
      n = n - (d * (b - c));
      if (n >= b) {
        d++;
        n = n - (b - c);
      }
      d = d + (n / a);
      cout << d;
    } else if (n > a)
      cout << n / a;
    else
      cout << "0";
  }
  return 0;
}
