#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, a, b, c, ans1, l, ans2;
  cin >> n >> a >> b >> c;
  ans1 = (n / a);
  l = (n % a);
  if (l >= b) ans1 += (l - b) / (b - c) + 1;
  if (n < b)
    ans2 = n / a;
  else {
    ans2 = (n - b) / (b - c) + 1;
    l = (n - b) % (b - c);
    l += c;
    if (l >= a) ans2 += l / a;
  }
  ans1 = max(ans1, ans2);
  cout << ans1;
}
