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