#include <bits/stdc++.h>
using namespace std;
const long long inf = LONG_MAX;
const long long arr = 1000000;
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first)
    return a.second < b.second;
  else
    return a.first < b.first;
}
int main(void) {
  long long n, a, b, c;
  cin >> n >> a >> b >> c;
  cout << max(n / a, max(0ll, (n - c) / (b - c)) +
                         (n - max(0ll, (n - c) / (b - c)) * (b - c)) / a)
       << '\n';
  return 0;
}
