#include <bits/stdc++.h>
using namespace std;
double PI = acos(-1.0);
int cs = 1, test;
long long int gcd(long long int a, long long int b) {
  return (a ? gcd(b % a, a) : b);
}
long long int power(long long int a, long long int n) {
  long long int p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
long long int power(long long int a, long long int n, long long int mod) {
  long long int p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
bool dbee(double a, double b) { return fabs(a - b) < 1e-8; }
bool dble(double a, double b) { return a < b - 1e-8; }
bool dbll(double a, double b) { return a < b + 1e-8; }
int Set(int N, int pos) { return N = N | (1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
int main() {
  long long int i, j, k, x, y, z, len, mx = -1;
  long long int n, a, b, c;
  cin >> n >> a >> b >> c;
  long long int ans = 0;
  ans = max(ans, n / a);
  long long int m = n;
  if (m < b)
    x = 0;
  else {
    x = (m - b) / (b - c);
    m -= x * (b - c);
    while (1) {
      if (m / b == 0) break;
      x += m / b;
      m = (m / b) * c + (m % b);
    }
    x += m / a;
  }
  ans = max(ans, x);
  cout << ans << endl;
  return 0;
}
