#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a, b, c, ans = 0;
  cin >> n >> a >> b >> c;
  ans = n / a;
  if (n >= b)
    ans = max(ans, 1 + (n - b) / (b - c) + (c + (n - b) % (b - c)) / a);
  if (n >= b + a * 2)
    ans = max(ans, 3 + (n - b - a * 2) / (b - c) +
                       (c + (n - b - a * 2) % (b - c)) / a);
  cout << ans << '\n';
  return 0;
}
