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