#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a, b, c;
  cin >> a >> b >> c;
  long long buy;
  long long ans1, ans2;
  ans1 = n / a;
  if (b > n)
    ans2 = 0;
  else {
    buy = b - c;
    long long n1 = n - b + 1;
    ans2 = n1 / buy;
    if (n1 % buy != 0) ans2++;
  }
  if (n % a >= b) {
    long long n1 = n - a * ans1;
    buy = b - c;
    n1 -= b - 1;
    ans1 += (n1 / buy);
    if (n1 % buy != 0) ans1++;
  }
  n -= ans2 * (b - c);
  ans2 += n / a;
  cout << max(ans1, ans2);
  return 0;
}
