#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, a, b, c;
  cin >> n >> a >> b >> c;
  if (a <= b - c) {
    cout << n / a;
    cout << '\n';
    return;
  }
  long long ret = 0;
  if (n >= c) {
    ret += (n - c) / (b - c);
    n -= (b - c) * ret;
  }
  ret += n / min(a, b);
  cout << ret;
  cout << '\n';
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long _ = 1;
  for (long long i = 1; i <= _; i++) {
    solve();
  }
  return 0;
}
