#include <bits/stdc++.h>
using namespace std;
long long int n, t, m;
int vi[200010];
vector<int> v[200010];
map<int, int> mp;
int main() {
  long long int a, b, c, r, l = 0, tt;
  cin >> r >> a >> b >> c;
  if ((b - c) <= a) {
    if (r >= b) {
      tt = (long long int)((double)(r - b) / (double)(b - c));
      t = tt++;
      if (t == tt) {
        t++;
      }
      r = r - t * (b - c);
      l = l + t;
      while (r >= b) {
        r = r - (b - c);
        l++;
      }
    }
    if (r >= a) {
      t = r / a;
      r = r - t * a;
      l = l + t;
    }
  } else {
    if (r >= a) {
      t = r / a;
      r = r - t * a;
      l = l + t;
    }
    if (r >= b) {
      tt = (long long int)((double)(r - b) / (double)(b - c));
      t = tt++;
      if (t == tt) {
        t++;
      }
      r = r - t * (b - c);
      l = l + t;
      while (r >= b) {
        r = r - (b - c);
        l++;
      }
    }
  }
  cout << l << endl;
  return 0;
}
