#include <bits/stdc++.h>
using namespace std;
long long n, m;
int main() {
  int t, i, j;
  long long a, b, c;
  scanf("%lld", &n);
  scanf("%lld%lld%lld", &a, &b, &c);
  if (a > n && b > n) {
    printf("0\n");
    return 0;
  }
  long long ans = 0;
  if (a <= b - c) {
    ans = n / a;
    printf("%lld\n", ans);
  } else {
    ans = (n - c) / (b - c);
    if (ans < 0) {
      printf("%lld\n", n / a);
      return 0;
    }
    ans += (n - (n - c) / (b - c) * (b - c)) / a;
    printf("%lld\n", ans);
  }
  return 0;
}
