#include <bits/stdc++.h>
using namespace std;
struct point {
  long long x, y;
  point() { x = y = 0; }
  point(long long xx, long long yy) {
    x = xx;
    y = yy;
  }
  point operator+(point p) { return point(x + p.x, y + p.y); }
  point operator-(point p) { return point(x - p.x, y - p.y); }
  point operator*(long long a) { return point(x * a, y * a); }
  double operator*(point p) { return x * p.x + y * p.y; }
  double len2() { return (*this) * (*this); }
  double len() { return sqrt((*this).len2()); }
  bool operator==(point p) { return ((*this) - p).len() < 1e-7; }
};
struct numb {
  vector<int> vec;
  numb(int n) { vec.push_back(n); }
  numb() { vec.push_back(0); }
  numb operator*(numb n) {
    numb ans;
    ans.vec.resize(n.vec.size() + vec.size() + 1);
    for (int(i) = (0); i < (vec.size()); ++(i)) {
      long long curr = 0;
      for (int(j) = (0); j < (n.vec.size()); ++(j)) {
        curr += 1LL * vec[i] * n.vec[j] + ans.vec[i + j];
        ans.vec[i + j] = curr % 1000000000;
        curr /= 1000000000;
      }
      ans.vec[i + n.vec.size()] += curr;
    }
    while (ans.vec.size() > 1 && ans.vec.back() == 0) ans.vec.pop_back();
    return ans;
  }
  numb pow(int h) {
    numb ans = 1;
    for (int(i) = (0); i < (h); ++(i)) ans = ans * (*this);
    return ans;
  }
  void print() {
    printf("%d", vec.back());
    for (int(i) = (vec.size() - 1) - 1; (i) >= (0); --(i))
      printf("%09d", vec[i]);
    printf("\n");
  }
};
long long a, b, c, n;
int main() {
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(7);
  cin >> n >> a >> b >> c;
  long long kk = max(0 * 1LL, (n % a) - c) / (b - c);
  long long ans = n / a + kk + (n % a - kk * (b - c)) / b;
  kk = max(0 * 1LL, n - c) / (b - c);
  ans = max(ans, kk + max((n - kk * (b - c)) / b, (n - kk * (b - c)) / a));
  cout << ans << endl;
  return 0;
}
