#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9, maxn = (int)1e5 + 5;
const double eps = (double)1e-8;
const int mod = (int)1000000007;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, a, b, c, o, o1, x;
  cin >> n >> a >> b >> c;
  o = n / a;
  n -= (long long)c;
  if (n > 0) {
    o = max(o, n / (b - c) + (n % (b - c) + c) / a);
  }
  cout << o;
  return 0;
}
