#include using namespace std; typedef long long ll; typedef long double ld; #define rep(i, n) for (ll i = 0; i < n; i++) #define FOR(i, a, b) for (ll i = a; i < b; i++) #define is(a, b) a == b #define len(v) ll(v.size()) const ll INF = 1LL << 58; class UnionFind{ public: vector par;//親の番号 vector rank;//木の深さ UnionFind(int n){//全ての要素に対して自身が根となるように初期化, 木の深さは0になる rep(i,n){ par.push_back(i); rank.push_back(0); } } int find(int x) {//木の根を求める if(par[x]==x){ return x; }else{ return par[x]=find(par[x]); } } void unite(int x,int y){//xとyの属する集合を併合 x=find(x); y=find(y); if(x==y) return; if(rank[x] int former(const vector &v, T x){ return upper_bound(v.begin(), v.end(), x) - v.begin() - 1; } //x以上の要素への最小index template int latter(const vector &v, T x){ return lower_bound(v.begin(), v.end(), x) - v.begin(); } //vector書き出し template void cout_vec(const vector &vec1){ rep(i,len(vec1)){ cout< T comb(T n,T k){ T ans=1; FOR(i,n-k+1,n+1){ ans*=i; } FOR(i,1,k+1){ ans/=i; } return ans; } //a,bの最大公約数 template T gcd(T a,T b){ if (b == 0) return a; else return gcd(b, a % b); } //素因数分解 template map prime_factor(T x){ map ans; for(T i=2;i*i<=x;i++){ while(x%i==0){ x/=i; ans[i]++; } } if (x!=1){ ans[x]=1; } return ans; } //約数列挙 template vector divisor(T x){ vector res; for(T i=1;i*i<=x;i++){ if(x%i==0){ res.push_back(i); if(i!=x/i){ res.push_back(x/i); } } } return res; } //素数判定 template bool is_prime(T x){ for(T i=2;i*i<=x;i++){ if(x%i==0){ return false; } } return x!=1; } int main(){ cin.tie(0); ios::sync_with_stdio(false); int a,b,c,d; cin>>a>>b>>c>>d; int ans=0; rep(i,a+1){ if(c*i<=b && i+c*i<=d && ans