#include <bits/stdc++.h>
using namespace std;
long long n, a, b, c;
long long ans;
long long z;
int main() {
  scanf("%I64d%I64d%I64d%I64d", &n, &a, &b, &c);
  if (n < a && n < b) {
    printf("0\n");
    return 0;
  }
  ans = n / a;
  z = 1LL;
  long long dif = b - c;
  n -= b;
  if (n < 0) {
    printf("%I64d\n", max(z, ans));
    return 0;
  }
  long long now = n / dif;
  z += now;
  n += c;
  n -= dif * now;
  z += max(n / a, n / b);
  printf("%I64d\n", max(ans, z));
  return 0;
}
