#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a, b, c;
  cin >> n >> a >> b >> c;
  long long res = 0;
  if (b - c >= a || b > n)
    res = n / a;
  else {
    long long foo = b - c;
    long long t = (n - b) / foo;
    res += t;
    n = n - t * foo;
    long long bar = 1;
    long long n_p = n;
    n_p = n_p - b + c;
    bar += (n_p / a);
    long long bar_2 = n / a;
    res += max(bar, bar_2);
  }
  cout << res << endl;
  return 0;
}
