#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long int find(long long int n, long long int a, long long int b,
                   long long int c) {
  long long d;
  d = b - c;
  long long ans1 = -1, ans2 = -1;
  ans1 = n / a;
  if (n >= b) {
    long long rem;
    ans2 = (n - b) / d + 1;
    rem = (n - b) % d + c;
    ans2 += rem / a;
  }
  return max(ans1, ans2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, a, b, c;
  cin >> n >> a >> b >> c;
  cout << find(n, a, b, c) << '\n';
  return 0;
}
