#include <bits/stdc++.h>
using namespace std;
long long n, a, b, c, d, p, ans;
long long fun(long long &k) {
  long long sum;
  d = b - c;
  p = k - c;
  sum = p / d;
  p = p % d + c;
  if (p >= b) {
    p -= b;
    sum++;
    p += c;
  }
  k = p;
  return sum;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long sum, sum1, k;
  cin >> n >> a >> b >> c;
  if (a < b - c) {
    cout << n / a << "\n";
    return 0;
  }
  ans = n / a;
  k = n;
  sum = fun(k);
  sum += k / a;
  k %= a;
  if (sum > ans) ans = sum;
  sum = n / a;
  k = n % a;
  sum += fun(k);
  if (sum > ans) ans = sum;
  cout << ans << "\n";
  return 0;
}
