#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a, b, c;
  scanf("%lld%lld%lld%lld", &n, &a, &b, &c);
  long long ans1 = n / a;
  long long k = (n - c) / (b - c);
  long long ans2 = k;
  long long s = n - k * (b - c);
  if (s >= a) ans2 += s / a;
  if (n < a && n < b)
    puts("0");
  else if (n < a)
    printf("%lld\n", ans2);
  else if (n < b)
    printf("%lld\n", ans1);
  else
    printf("%lld\n", max(ans1, ans2));
  return 0;
}
