#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a, b, c, ans;
  cin >> n >> a >> b >> c;
  if (a <= b - c)
    ans = n / a;
  else {
    long long k = (n - b) / (b - c);
    if (k < 0LL) k = 0LL;
    long long rest = n - k * (b - c);
    if (rest >= b) rest = n - (++k) * (b - c);
    ans = k + rest / min(a, b);
  }
  cout << ans << "\n";
}
