#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#define DBLE 1e-8
#define PI 3.1415926535898
#define MAXN 100100
#define INF 1000000000
using namespace std;
int alpha[2][30]={0};
char str[2][MAXN];
inline int re(int h)
{
    while(h<26&&alpha[0][h]>=alpha[1][h])
        ++h;
    return h;
}
inline int re2(int h)
{
    while(h>=0&&alpha[0][h]>=alpha[1][h])
        --h;
    return h;
}
int main()
{
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    int ans=0,last=0,len;
    scanf("%s%s",str[0],str[1]);
    for(int i=0;str[0][i];++i)
        ++alpha[0][str[0][i]-'A'],++alpha[1][str[1][i]-'A'];
    for(int i=0;i<26;++i)
        ans+=abs(alpha[0][i]-alpha[1][i]);
    printf("%d\n",ans/2);
    last=re(last);
    for(int i=0;str[0][i];++i,len=i)
        if(alpha[0][str[0][i]-'A']>alpha[1][str[0][i]-'A']&&str[0][i]-'A'>last)
        {
            --alpha[0][str[0][i]-'A'],++alpha[0][last];
            str[0][i]=last+'A';
            last=re(last);
        }
    last=25;
    last=re2(last);
    for(int i=len-1;i>=0;--i)
        if(alpha[0][str[0][i]-'A']>alpha[1][str[0][i]-'A'])
        {
            --alpha[0][str[0][i]-'A'],++alpha[0][last];
            str[0][i]=last+'A';
            last=re2(last);
        }
    printf("%s\n",str[0]);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#define DBLE 1e-8
#define PI 3.1415926535898
#define MAXN 100100
#define INF 1000000000
using namespace std;
int alpha[2][30]={0};
char str[2][MAXN];
inline int re(int h)
{
    while(h<26&&alpha[0][h]>=alpha[1][h])
        ++h;
    return h;
}
inline int re2(int h)
{
    while(h>=0&&alpha[0][h]>=alpha[1][h])
        --h;
    return h;
}
int main()
{
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    int ans=0,last=0,len;
    scanf("%s%s",str[0],str[1]);
    for(int i=0;str[0][i];++i)
        ++alpha[0][str[0][i]-'A'],++alpha[1][str[1][i]-'A'];
    for(int i=0;i<26;++i)
        ans+=abs(alpha[0][i]-alpha[1][i]);
    printf("%d\n",ans/2);
    last=re(last);
    for(int i=0;str[0][i];++i,len=i)
        if(alpha[0][str[0][i]-'A']>alpha[1][str[0][i]-'A']&&str[0][i]-'A'>last)
        {
            --alpha[0][str[0][i]-'A'],++alpha[0][last];
            str[0][i]=last+'A';
            last=re(last);
        }
    last=25;
    last=re2(last)
    for(int i=len-1;i>=0;--i)
        if(alpha[0][str[0][i]-'A']>alpha[1][str[0][i]-'A'])
        {
            --alpha[0][str[0][i]-'A'],++alpha[0][last];
            str[0][i]=last+'A';
            last=re2(last);
        }
    printf("%s\n",str[0]);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#define DBLE 1e-8
#define PI 3.1415926535898
#define MAXN 100100
#define INF 1000000000
using namespace std;
int alpha[2][30]={0};
char str[2][MAXN];
inline int re(int h)
{
    while(h<26&&alpha[0][h]>=alpha[1][h])
        ++h;
    return h;
}
inline int re2(int h)
{
    while(h>=0&&alpha[0][h]>=alpha[1][h])
        --h;
    return h;
}
int main()
{
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    int ans=0,last=0;
    scanf("%s%s",str[0],str[1]);
    for(int i=0;str[0][i];++i)
        ++alpha[0][str[0][i]-'A'],++alpha[1][str[1][i]-'A'];
    for(int i=0;i<26;++i)
        ans+=abs(alpha[0][i]-alpha[1][i]);
    printf("%d\n",ans/2);
    last=re(last);
    for(int i=0;str[0][i];++i)
        if(alpha[0][str[0][i]-'A']>alpha[1][str[0][i]-'A']&&str[0][i]-'A'>last)
        {
            --alpha[0][str[0][i]-'A'],++alpha[0][last];
            str[0][i]=last+'A';
            last=re(last);
        }
    last=25;
    last=re2(last);
    for(int i=strlen(str)-1;i>=0;--i)
        if(alpha[0][str[0][i]-'A']>alpha[1][str[0][i]-'A'])
        {
            --alpha[0][str[0][i]-'A'],++alpha[0][last];
            str[0][i]=last+'A';
            last=re2(last);
        }
    printf("%s\n",str[0]);
    return 0;
}


#include <cstdio>
#include <stack>
using namespace std;

char s[100001], t[100001];
int cnt[128], dnt[128], n;
stack<char> S;

int main() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  scanf("%s%s", s, t);
  for (int i(0); s[i]; ++i) {
    ++dnt[s[i]];
    --cnt[s[i]];
    ++cnt[t[i]];
  }
  printf("%d, %d, %d\n", cnt['A'], cnt['B'], cnt['C']);
  for (char i('Z'); i >= 'A'; --i)
    for (int j(0); j < cnt[i]; ++j)
      S.push(i);
  n = S.size();
  for (int i(0); !S.empty(); ++i) {
    if (cnt[s[i]] < 0)
      if (S.top() < s[i] || dnt[s[i]] + cnt[s[i]] == 0) {
        ++cnt[s[i]];
        s[i] = S.top();
        S.pop();
      }
    --dnt[s[i]];
  }
  printf("%d\n%s\n", n, s);
  fclose(stdin);
  fclose(stdout);
}


#include <cstdio>
#include <stack>
using namespace std;

char s[100001], t[100001];
int cnt[128], dnt[128], n;
stack<char> S;

int main() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  scanf("%s%s", s, t);
  for (int i(0); s[i]; ++i) {
    ++dnt[s[i]];
    --cnt[s[i]];
    ++cnt[t[i]];
  }
  for (char i('Z'); i >= 'A'; --i)
    for (int j(0); j < cnt[i]; ++j)
      S.push(i);
  n = S.size();
  for (int i(0); !S.empty(); ++i) {
    if (cnt[s[i]] < 0)
      if (S.top() < s[i] || dnt[s[i]] + cnt[s[i]] == 0) {
        s[i] = S.top();
        S.pop();
        ++cnt[s[i]];
      }
    --dnt[s[i]];
  }
  printf("%d\n%s\n", n, s);
  fclose(stdin);
  fclose(stdout);
}


#include <cstdio>
#include <stack>
using namespace std;

char s[100001], t[100001];
int cnt[128], dnt[128], n;
stack<char> S;

int main() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  scanf("%s%s", s, t);
  for (int i(0); s[i]; ++i) {
    ++dnt[s[i]];
    --cnt[s[i]];
    ++cnt[t[i]];
  }
  for (char i('Z'); i >= 'A'; --i)
    for (int j(0); j < cnt[i]; ++j)
      S.push(i);
  n = S.size();
  for (int i(0); !S.empty(); ++i) {
    if (cnt[s[i]] < 0)
      if (S.top() < s[i] || dnt[s[i]] + cnt[s[i]] == 0) {
        ++cnt[s[i]];
        s[i] = S.top();
        S.pop();
      }
    --dnt[s[i]];
  }
  printf("%d\n%s\n", n, s);
  fclose(stdin);
  fclose(stdout);
}


#include <cstdio>
#include <stack>
using namespace std;

char s[100001], t[100001];
int cnt[128], dnt[128], n;
stack<char> S;

int main() {
  scanf("%s%s", s, t);
  for (int i(0); s[i]; ++i) {
    ++dnt[s[i]];
    --cnt[s[i]];
    ++cnt[t[i]];
  }
  for (char i('Z'); i >= 'A'; --i)
    for (int j(0); j < cnt[i]; ++j)
      S.push(i);
  n = S.size();
  for (int i(0); !S.empty(); ++i) {
    if (cnt[s[i]] < 0)
      if (S.top() < s[i] || dnt[s[i]] + cnt[s[i]] == 0) {
        s[i] = S.top();
        S.pop();
        ++cnt[s[i]];
      }
    --dnt[s[i]];
  }
  printf("%d\n%s\n", n, s);
}


#include <cstdio>
#include <cstring>

char s[100001],t[100001],u[100000];
int cnt[26],ui;

int main() {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    scanf("%s%s", s, t);
    for (int i=0; s[i]; i++)
        cnt[s[i] - 'A']--;
    for (int i=0; t[i]; i++)
        cnt[t[i] - 'A']++;
    for (int i=0; i<26; i++)
        while (cnt[i] > 0) {
            u[ui++] = i + 'A';
            cnt[i]--;
        }
    printf("%d\n", ui);
    int f = strlen(s);
    int cnt2[26];
    memcpy(cnt2, cnt, sizeof(cnt2));
    while (ui > 0) {
        f--;
        if (cnt2[s[f] - 'A'] < 0) {
            ui--;
            cnt2[s[f] - 'A']++;
        }
    }
    for (int i=0; s[i]; i++)
        if (cnt[s[i] - 'A'] < 0 && (u[ui] < s[i] || i >= f)) {
            cnt[s[i] - 'A']++;
            s[i] = u[ui++];
        }
    puts(s);
}


#include <cstdio>
#include <stack>
using namespace std;

char s[100001], t[100001];
int cnt[128], dnt[128], n;
stack<char> S;

int main() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  scanf("%s%s", s, t);
  for (int i(0); s[i]; ++i) {
    ++dnt[s[i]];
    --cnt[s[i]];
    ++cnt[t[i]];
  }
  for (char i('Z'); i >= 'A'; --i)
    for (int j(0); j < cnt[i]; ++j)
      S.push(i);
  n = S.size();
  for (int i(0); !S.empty(); ++i) {
    --dnt[s[i]];
    if (cnt[s[i]] < 0)
      if (S.top() < s[i] || dnt[s[i]] < -cnt[s[i]]) {
        ++cnt[s[i]];
        s[i] = S.top();
        S.pop();
      }
  }
  printf("%d\n%s\n", n, s);
  fclose(stdin);
  fclose(stdout);
}


#include <cstdio>
#include <cstring>

char s[100001],t[100001],u[100000];
int cnt[26],ui;

int main() {
    freopen("input.txt", "r", stdin);
    freopne("output.txt", "w", stdout);
    scanf("%s%s", s, t);
    for (int i=0; s[i]; i++)
        cnt[s[i] - 'A']--;
    for (int i=0; t[i]; i++)
        cnt[t[i] - 'A']++;
    for (int i=0; i<26; i++)
        while (cnt[i] > 0) {
            u[ui++] = i + 'A';
            cnt[i]--;
        }
    printf("%d\n", ui);
    int f = strlen(s);
    int cnt2[26];
    memcpy(cnt2, cnt, sizeof(cnt2));
    while (ui > 0) {
        f--;
        if (cnt2[s[f] - 'A'] < 0) {
            ui--;
            cnt2[s[f] - 'A']++;
        }
    }
    for (int i=0; s[i]; i++)
        if (cnt[s[i] - 'A'] < 0 && (u[ui] < s[i] || i >= f)) {
            cnt[s[i] - 'A']++;
            s[i] = u[ui++];
        }
    puts(s);
}


#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
const int MX = 1e5+1;
char s[MX], t[MX];
int a[27], b[27];

int c(char s) {
	return (int)s - 'A';
}

int main() {
	freopen ("input.txt", "r", stdin);
	freopen ("output.txt", "w", stdout);
	scanf("%s%s", &s, &t);
	int sz = strlen(s);
	for (int i = 0; i < sz; i++) {
		a[c(s[i])]++;
		a[c(t[i])]--;
		b[c(s[i])]++;
	}
	int ans = 0;
	for (int i = 0; i < sz; i++) {
		if (a[c(s[i])] > 0) {
			int d = c(s[i]);
			b[d]--;
			bool done = 0;
			for (int j = 0; j < d; j++) {
				if (a[j] < 0) {
					s[i] = (char)j+'A';
					a[d]--; a[j]++; ans++;
					done = 1;
					break;
				}
			}
			if (!done && b[d] < a[d]) {
				for (int j = d; j < 26; j++) {
					if (a[j] < 0) {
						s[i] = (char)j+'A';
						a[d]--; a[j]++; ans++;
						break;
					}
				}
			}
		}
	}
	printf("%d\n%s", ans, s);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
// bool isPrime(int n){
//     if(n<=1){
//         return false;
//     }
//     for(int i=2;i<n;i++){
//         if(n%i==0){
//             return false;
//         }
//     }
//     return true;
// }

// int countDivisors(int n){
//     int cnt=0;
//     for(int i=1;i<=sqrt(n);i++){
//         if(n%i==0){
//             if(n/i==i){
//                 cnt++;
//             }
//             else {
//                 cnt=cnt+2;
//             }
//         }
//     }
//     return cnt;
// }

// int gcd(int a ,int b)
// {
//     if(b==0)
//     {
//         return a;
//     }
//     if(b>a)
//     {
//         return gcd(b,a);
//     }
//     else
//     {
//         return gcd(b,a%b);
//     }
// }

//long long ncr(long long n , long long r )
// {
//     if(n==1 || r==0 ||r==n)
//     {
//         return 1;
//     }
//     else if( r==1 || r==n-1)
//     {
//         return n%MOD;
//     }
//     else if(v[n][r]!=-1)
//     {
//         return (v[n][r])%MOD;
//     }
//     else
//     {
//         v[n][r]=((ncr(n-1,r)%MOD)+(ncr(n-1,r-1)%MOD))%MOD;
//         return v[n][r];
//     }
// }

int main() {
        ll n,a,b,k;
        cin>>n>>a>>b>>k;
        int h[n];
        for(int i=0;i<n;i++){
            cin>>h[i];
        }
        int count=0;
        vector<ll> v;
            for(int i=0;i<n;i++){
                int x=(h[i]%(a+b));
                if(x==0){
                v.push_back((a+b)/a);}
                else {
                    v.push_back((x-1)/a);
                }
                //cout<<v[i];
            }
        sort(v.begin(),v.end());
        int i=0;
        while(count<k and i<v.size()){
            count=count+v[i];
            i++;
        }
        cout<<i<<endl;
	// your code goes here
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
// bool isPrime(int n){
//     if(n<=1){
//         return false;
//     }
//     for(int i=2;i<n;i++){
//         if(n%i==0){
//             return false;
//         }
//     }
//     return true;
// }

// int countDivisors(int n){
//     int cnt=0;
//     for(int i=1;i<=sqrt(n);i++){
//         if(n%i==0){
//             if(n/i==i){
//                 cnt++;
//             }
//             else {
//                 cnt=cnt+2;
//             }
//         }
//     }
//     return cnt;
// }

// int gcd(int a ,int b)
// {
//     if(b==0)
//     {
//         return a;
//     }
//     if(b>a)
//     {
//         return gcd(b,a);
//     }
//     else
//     {
//         return gcd(b,a%b);
//     }
// }

//long long ncr(long long n , long long r )
// {
//     if(n==1 || r==0 ||r==n)
//     {
//         return 1;
//     }
//     else if( r==1 || r==n-1)
//     {
//         return n%MOD;
//     }
//     else if(v[n][r]!=-1)
//     {
//         return (v[n][r])%MOD;
//     }
//     else
//     {
//         v[n][r]=((ncr(n-1,r)%MOD)+(ncr(n-1,r-1)%MOD))%MOD;
//         return v[n][r];
//     }
// }

int main() {
        ll n,a,b,k;
        cin>>n>>a>>b>>k;
        int h[n];
        for(int i=0;i<n;i++){
            cin>>h[i];
        }
        vector<ll> v;
            for(int i=0;i<n;i++){
                int x=(h[i]%(a+b));
                if(x==0){
                v.push_back((a+b-1)/a);}
                else {
                    v.push_back((x-1)/a);
                }
                //cout<<v[i];
            }
        sort(v.begin(),v.end());
        if(k<v[0]){
            cout<<0<<endl;
        }
        else {
        int count=0;
        int i=0;
        while(count<k and i<v.size()){
            count=count+v[i];
            i++;
        }
        if(count<=k){
        cout<<i<<endl;}
        else {
            cout<<i-1<<endl;
        }
        }
	// your code goes here
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
// bool isPrime(int n){
//     if(n<=1){
//         return false;
//     }
//     for(int i=2;i<n;i++){
//         if(n%i==0){
//             return false;
//         }
//     }
//     return true;
// }

// int countDivisors(int n){
//     int cnt=0;
//     for(int i=1;i<=sqrt(n);i++){
//         if(n%i==0){
//             if(n/i==i){
//                 cnt++;
//             }
//             else {
//                 cnt=cnt+2;
//             }
//         }
//     }
//     return cnt;
// }

// int gcd(int a ,int b)
// {
//     if(b==0)
//     {
//         return a;
//     }
//     if(b>a)
//     {
//         return gcd(b,a);
//     }
//     else
//     {
//         return gcd(b,a%b);
//     }
// }

//long long ncr(long long n , long long r )
// {
//     if(n==1 || r==0 ||r==n)
//     {
//         return 1;
//     }
//     else if( r==1 || r==n-1)
//     {
//         return n%MOD;
//     }
//     else if(v[n][r]!=-1)
//     {
//         return (v[n][r])%MOD;
//     }
//     else
//     {
//         v[n][r]=((ncr(n-1,r)%MOD)+(ncr(n-1,r-1)%MOD))%MOD;
//         return v[n][r];
//     }
// }

int main() {
        ll n,a,b,k;
        cin>>n>>a>>b>>k;
        int h[n];
        for(int i=0;i<n;i++){
            cin>>h[i];
        }
        vector<ll> v;
            for(int i=0;i<n;i++){
                int x=(h[i]%(a+b));
                if(x==0){
                v.push_back((a+b)/a);}
                else {
                    v.push_back((x-1)/a);
                }
                //cout<<v[i];
            }
        sort(v.begin(),v.end());
        if(k<v[0]){
            cout<<0<<endl;
        }
        else {
        int count=0;
        int i=0;
        while(count<=k and i<v.size()){
            count=count+v[i];
            i++;
        }
        if(count<=k){
        cout<<i<<endl;}
        else {
            cout<<i-1<<endl;
        }
        }
	// your code goes here
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
ll n,a,b,k,m;
vector < ll > v;
long long solve(){
ll s=1,e=m,tar,mid;
  while(s<=e){
    mid=(s+e)/2;
    tar=m-a*mid-b*(mid-1);
    if(tar==0)return mid;
    if(tar>0)s=mid+1;
    if(tar<0)e=mid-1;
    }
return mid;
}
int main()
{    ll ans=0,temp;
     cin>>n>>a>>b>>k;
     for(int i=0;i<n;i++){
        cin>>m;
       ll x=solve();
       x--;
       if(m-x*a-x*b<=0){
            v.push_back(m-x*a-(x-1)*b);
       }
       else
        ans++;}
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++)
        {  bool chk=true;
            int ind=1;
            while(v[i]>0){
                if(k==0)
                {
                    chk=false;
                    break;
                }
                v[i]-=a;
                if(ind&1)
                       k--;
              ind++;
            }
            if(chk)ans++;
             else
                break;
        }
     cout<<ans<<endl;

    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
ll n,a,b,k,m;
vector < ll > v;
long long solve(){
ll s=1,e=m,tar,mid;
  while(s<=e){
    mid=(s+e)/2;
    tar=m-a*mid-b*(mid-1);
    if(tar==0)return mid;
    if(tar>0)s=mid+1;
    if(tar<0)e=mid-1;
    }
return mid;
}
int main()
{    ll ans=0,temp;
     cin>>n>>a>>b>>k;
     for(int i=0;i<n;i++){
        cin>>m;
       ll x=solve();
       x--;
       if(m-x*a-x*b<=0){
            v.push_back(m-x*a-x*b+b);
       }
       else
        ans++;}
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++)
        {  bool chk=true;
            int ind=1;
            while(v[i]>0){
                if(k==0)
                {
                    chk=false;
                    break;
                }
                v[i]-=a;
                if(ind&1)
                       k--;
            }
            if(chk)ans++;
             else
                break;
        }
     cout<<ans<<endl;

    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
ll n,a,b,k,m;
vector < ll > v;
long long solve(){
ll s=1,e=m,tar,mid;
  while(s<=e){
    mid=(s+e)/2;
    tar=m-a*mid-b*(mid-1);
    if(tar==0)return mid;
    if(tar>0)s=mid+1;
    if(tar<0)e=mid-1;
    }
return mid;
}
int main()
{    ll ans=0,temp;
     cin>>n>>a>>b>>k;
     for(int i=0;i<n;i++){
        cin>>m;
       ll x=solve();
       x--;
       if(m-x*a-x*b<=0){
            v.push_back(m-x*a-((x-1)*b));
       }
       else
        ans++;}
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++)
        {  bool chk=true;
            while(v[i]>0){
                if(k==0)
                {
                    chk=false;
                    break;
                }
                v[i]-=a;
                 k--;
            }
            if(chk)ans++;
             else
                break;
        }
     cout<<ans<<endl;

    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
ll n,a,b,k,m;
vector < ll > v;
long long solve(){
ll s=1,e=m,tar,mid;
  while(s<=e){
    mid=(s+e)/2;
    tar=m-a*mid-b*(mid-1);
    if(tar==0)return mid;
    if(tar>0)s=mid+1;
    if(tar<0)e=mid-1;
    }
return mid;
}
int main()
{    ll ans=0,temp;
     cin>>n>>a>>b>>k;
     for(int i=0;i<n;i++){
        cin>>m;
       ll x=solve();
       x--;
       if(m-x*a-x*b<=0){
            v.push_back(m-x*a-x*b+b);
       }
       else
        ans++;}
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++)
        {  bool chk=true;
            int ind=1;
            while(v[i]>0){
                if(k==0)
                {
                    chk=false;
                    break;
                }
                v[i]-=a;
                if(ind&1)
                       k--;
              ind++;
            }
            if(chk)ans++;
             else
                break;
        }
     cout<<ans<<endl;

    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
ll n,a,b,k,m;
vector < ll > v;
long long solve(){
ll s=1,e=m,tar,mid;
  while(s<=e){
    mid=(s+e)/2;
    tar=m-a*mid-b*(mid-1);
    if(tar==0)return mid;
    if(tar>0)s=mid+1;
    if(tar<0)e=mid-1;
    }
return mid;
}
int main()
{    ll ans=0,temp;
     cin>>n>>a>>b>>k;
     for(int i=0;i<n;i++){
        cin>>m;
       ll x=solve();
       x--;
       if(m-x*a-x*b<=0){
            v.push_back(m-x*a-((x-1)*b));
       }
       else
        ans++;}
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++)
        {  bool chk=true;
            int ind=1;
            while(v[i]>0){
                if(k==0)
                {
                    chk=false;
                    break;
                }
                v[i]-=a;
                if(ind&1)
                       k--;
              ind++;
            }
            if(chk)ans++;
             else
                break;
        }
     cout<<ans<<endl;

    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
int main()
{   ll n,a,b,k,ans=0,x,temp;
    cin>>n>>a>>b>>k;
    vector < ll > arr;
    temp=a+b;
    for(int i=0;i<n;i++){
        cin>>x;
        x%=temp;
        if(x==0){
            arr.push_back(b);
        }
        else if(x<=a)ans++;
        else{
         arr.push_back(x-a);
        }}
    sort(arr.begin(),arr.end());
    //cout<<ans<<endl;
    for(int i=0;i<arr.size();i++){
     //cout<<arr[i]<<endl;
        if(arr[i]<=0){
            ans++;
            continue;
        }
        temp=arr[i]/a;
        if(arr[i]%a)temp++;
        k-=temp;
        if(k<0)break;
        ans++;
    }
    cout<<ans<<endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long int
mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
#define mp make_pair
#define pb push_back
#define F first
#define S second
const int N=100005;
#define M 1000000007
#define double long double
#define BINF 100000000000000
#define init(arr,val) memset(arr,val,sizeof(arr))
#define MAXN 17500001
#define deb(x) cout << #x << " " << x << "\n";
const int LG = 22;

#undef int
int main() {
#define int long long int
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);

#ifndef ONLINE_JUDGE
    freopen("ip.txt", "r", stdin);
    freopen("op2.txt", "w", stdout);
#endif

    int n, a, b, k;
    cin >> n >> a >> b >> k;
    int h[n];
    for(int i = 0; i < n; i++)
        cin >> h[i];
    vector<int>v;
    int ans = 0;
    for(int i = 0; i < n; i++){
        h[i] -= a;
        if(h[i] <= 0) ans++;
        else v.push_back(h[i] % (b + a));
    }

    if(v.size() == 0){
        cout << ans << endl;
        return 0;
    }

    sort(v.begin(), v.end());

    for(auto i : v){
        if(i > b){
            ans++;
            continue;
        }
        int need = i / a + i % a;
        if(need <= k){
            k -= need;
            ans++;
        }

    }

    cout << ans << endl;

return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long int
mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
#define mp make_pair
#define pb push_back
#define F first
#define S second
const int N=100005;
#define M 1000000007
#define double long double
#define BINF 100000000000000
#define init(arr,val) memset(arr,val,sizeof(arr))
#define MAXN 17500001
#define deb(x) cout << #x << " " << x << "\n";
const int LG = 22;

#undef int
int main() {
#define int long long int
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);

#ifndef ONLINE_JUDGE
    freopen("ip.txt", "r", stdin);
    freopen("op2.txt", "w", stdout);
#endif

    int n, a, b, k;
    cin >> n >> a >> b >> k;
    int h[n];
    for(int i = 0; i < n; i++)
        cin >> h[i];
    sort(h, h + n);
    vector<int>v;
    int ans = 0;
    for(int i = 0; i < n; i++){
        h[i] -= a;
        if(h[i] <= 0){
            ans++;
            continue;
        }
        if(h[i] % (b + a) == 0){
            ans++;
            continue;
        }
        else v.push_back(h[i] % (b + a));
    }

    if(v.size() == 0){
        cout << ans << endl;
        return 0;
    }

    sort(v.rbegin(), v.rend());
    multiset<int>s;

    //for(auto i : v)
    //    cout << i << ' ';
    //cout << endl;

    for(auto i : v){
        if(i > b){
            ans++;
            continue;
        }
        int need = i / a + (i % a != 0);
        s.insert(need);

    }

    for(auto i : s){
        if(i <= k){
            k -= i;
            ans++;
        }
    }

    cout << ans << endl;

return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long int
mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
#define mp make_pair
#define pb push_back
#define F first
#define S second
const int N=100005;
#define M 1000000007
#define double long double
#define BINF 100000000000000
#define init(arr,val) memset(arr,val,sizeof(arr))
#define MAXN 17500001
#define deb(x) cout << #x << " " << x << "\n";
const int LG = 22;

#undef int
int main() {
#define int long long int
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);

#ifndef ONLINE_JUDGE
    freopen("ip.txt", "r", stdin);
    freopen("op2.txt", "w", stdout);
#endif

    int n, a, b, k;
    cin >> n >> a >> b >> k;
    int h[n];
    for(int i = 0; i < n; i++)
        cin >> h[i];
    sort(h, h + n);
    vector<int>v;
    int ans = 0;
    for(int i = 0; i < n; i++){
        h[i] -= a;
        if(h[i] <= 0){
            ans++;
            continue;
        }
        if(h[i] % (b + a) == 0){
           // cout << i << endl;
            ans++;
            continue;
        }
        else v.push_back(h[i] % (b + a));
    }

    if(v.size() == 0){
        cout << ans << endl;
        return 0;
    }

    sort(v.rbegin(), v.rend());

    //for(auto i : v)
    //    cout << i << ' ';
    //cout << endl;

    for(auto i : v){
        if(i > b){
            ans++;
            continue;
        }
        int need = i / a + i % a;
        if(need <= k){
            k -= need;
            ans++;
        }

    }

    cout << ans << endl;

return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long int
mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
#define mp make_pair
#define pb push_back
#define F first
#define S second
const int N=100005;
#define M 1000000007
#define double long double
#define BINF 100000000000000
#define init(arr,val) memset(arr,val,sizeof(arr))
#define MAXN 17500001
#define deb(x) cout << #x << " " << x << "\n";
const int LG = 22;

#undef int
int main() {
#define int long long int
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);

#ifndef ONLINE_JUDGE
    freopen("ip.txt", "r", stdin);
    freopen("op2.txt", "w", stdout);
#endif

    int n, a, b, k;
    cin >> n >> a >> b >> k;
    int h[n];
    for(int i = 0; i < n; i++)
        cin >> h[i];
    vector<int>v;
    int ans = 0;
    for(int i = 0; i < n; i++){
        h[i] -= a;
        if(h[i] <= 0) ans++;
        else v.push_back(h[i] % (b + a));
    }

    if(v.size() == 0){
        cout << ans << endl;
        return 0;
    }

    sort(v.rbegin(), v.rend());

    for(auto i : v){
        if(i > b){
            ans++;
            continue;
        }
        int need = i / a + i % a;
        if(need <= k){
            k -= need;
            ans++;
        }

    }

    cout << ans << endl;

return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long int
mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
#define mp make_pair
#define pb push_back
#define F first
#define S second
const int N=100005;
#define M 1000000007
#define double long double
#define BINF 100000000000000
#define init(arr,val) memset(arr,val,sizeof(arr))
#define MAXN 17500001
#define deb(x) cout << #x << " " << x << "\n";
const int LG = 22;

#undef int
int main() {
#define int long long int
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);

#ifndef ONLINE_JUDGE
    freopen("ip.txt", "r", stdin);
    freopen("op2.txt", "w", stdout);
#endif

    int n, a, b, k;
    cin >> n >> a >> b >> k;
    int h[n];
    for(int i = 0; i < n; i++)
        cin >> h[i];
    vector<int>v;
    int ans = 0;
    for(int i = 0; i < n; i++){
        h[i] -= a;
        if(h[i] <= 0) ans++;
        if(h[i] % (b + a) == 0){
            ans++;
            continue;
        }
        else v.push_back(h[i] % (b + a));
    }

    if(v.size() == 0){
        cout << ans << endl;
        return 0;
    }

    sort(v.rbegin(), v.rend());

    for(auto i : v){
        if(i > b){
            ans++;
            continue;
        }
        int need = i / a + i % a;
        if(need <= k){
            k -= need;
            ans++;
        }

    }

    cout << ans << endl;

return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long int
mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
#define mp make_pair
#define pb push_back
#define F first
#define S second
const int N=100005;
#define M 1000000007
#define double long double
#define BINF 100000000000000
#define init(arr,val) memset(arr,val,sizeof(arr))
#define MAXN 17500001
#define deb(x) cout << #x << " " << x << "\n";
const int LG = 22;

#undef int
int main() {
#define int long long int
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);

#ifndef ONLINE_JUDGE
    freopen("ip.txt", "r", stdin);
    freopen("op2.txt", "w", stdout);
#endif

    int n, a, b, k;
    cin >> n >> a >> b >> k;
    int h[n];
    for(int i = 0; i < n; i++)
        cin >> h[i];
    sort(h, h + n);
    vector<int>v;
    int ans = 0;
    for(int i = 0; i < n; i++){
        h[i] -= a;
        if(h[i] <= 0){
            ans++;
            continue;
        }
        if(h[i] % (b + a) == 0){
           // cout << i << endl;
            ans++;
            continue;
        }
        else v.push_back(h[i] % (b + a));
    }

    if(v.size() == 0){
        cout << ans << endl;
        return 0;
    }

    sort(v.begin(), v.end());

    //for(auto i : v)
    //    cout << i << ' ';
    //cout << endl;

    for(auto i : v){
        if(i > b){
            ans++;
            continue;
        }
        int need = i / a + i % a;
        if(need <= k){
            k -= need;
            ans++;
        }

    }

    cout << ans << endl;

return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long int
mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
#define mp make_pair
#define pb push_back
#define F first
#define S second
const int N=100005;
#define M 1000000007
#define double long double
#define BINF 100000000000000
#define init(arr,val) memset(arr,val,sizeof(arr))
#define MAXN 17500001
#define deb(x) cout << #x << " " << x << "\n";
const int LG = 22;

#undef int
int main() {
#define int long long int
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);

#ifndef ONLINE_JUDGE
    freopen("ip.txt", "r", stdin);
    freopen("op2.txt", "w", stdout);
#endif

    int n, a, b, k;
    cin >> n >> a >> b >> k;
    int h[n];
    for(int i = 0; i < n; i++)
        cin >> h[i];
    vector<int>v;
    int ans = 0;
    for(int i = 0; i < n; i++){
        h[i] -= a;
        if(h[i] <= 0) ans++;
        else v.push_back(h[i] % (b + a));
    }

    if(v.size() == 0){
        cout << ans << endl;
        return 0;
    }

    sort(v.begin(), v.end());

    for(auto i : v){
        if(i > b){
            ans++;
            continue;
        }
        int need = i / a + (i % a != 0);
        if(need <= k){
            k -= need;
            ans++;
        }

    }

    cout << ans << endl;

return 0;
}


/*....Abhilash's coding template....*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define all(a) (a).begin(),(a).end()
#define vll vector<ll>
#define fl(i,a,b) for(ll i=a;i<=b;i++)
#define flr(i,a,b) for(ll i=a;i>=b;i--)
#define print(v) for(auto i=v.begin();i!=v.end();i++){cout<<*i<<" ";}cout<<"\n";
#define tr(c,i) for(decltype((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define keep_unique(v) sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); // keeps only unique elements in the vector v
#define test() ll te; cin >> te; while(te--)
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define PI 3.14159265
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int main()
{
    fast;
    {
        ll n,a,b,k; cin>>n>>a>>b>>k;
        vll v(n); fl(i,0,n-1) cin>>v[i];
        ll d=a+b;
        fl(i,0,n-1)
        {
            v[i]%=d;
        }
        //vll ht(d,0);
        map<ll,ll> ht;
        fl(i,0,n-1)
        {
            ht[v[i]]++;
        }
        ht[a+b]=ht[0];
       // print(ht);
        ll curr=0,x,pts=0;
        //for(int i=1;i<=d&&curr<k;i++)
        tr(ht,i)
        {
            //cout<<i<<" ";
            if(i->ff!=0&&curr<k)
            {
                if(i->ff<=a)
                {
                    pts+=ht[i->ff];
                }
                else
                {
                    x=ceil((float)i->ff/(float)a)-1;
                    if(x!=0)
                    {
                        ll w=(k-curr)/x;
                        w=min(w,ht[i->ff]);
                        pts+=w;
                        curr+=w*x;
                    }
                    else
                    {
                        pts++;
                        curr++;
                    }
                }
            }
            //DEBUG(pts); DEBUG(curr);
        }
        cout<<pts<<endl;

    }
}


/*....Abhilash's coding template....*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define all(a) (a).begin(),(a).end()
#define vll vector<ll>
#define fl(i,a,b) for(ll i=a;i<=b;i++)
#define flr(i,a,b) for(ll i=a;i>=b;i--)
#define print(v) for(auto i=v.begin();i!=v.end();i++){cout<<*i<<" ";}cout<<"\n";
#define tr(c,i) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define keep_unique(v) sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); // keeps only unique elements in the vector v
#define test() ll te; cin >> te; while(te--)
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define PI 3.14159265
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int main()
{
    fast;
    {
        ll n,a,b,k; cin>>n>>a>>b>>k;
        vll v(n); fl(i,0,n-1) cin>>v[i];
        ll d=a+b;
        fl(i,0,n-1)
        {
            v[i]%=d;
        }
        //vll ht(d,0);
        map<ll,ll> ht;
        fl(i,0,n-1)
        {
            ht[v[i]]++;
        }
        ht[a+b]=ht[0];
       // print(ht);
        ll curr=0,x,pts=0;
        for(int i=1;i<=d&&curr<k;i++)
        {
            //cout<<i<<" ";
            if(i<=a)
            {
                pts+=ht[i];
            }
            else
            {
                x=ceil((float)i/(float)a)-1;
                ll w=(k-curr)/x;
                w=min(w,ht[i]);
                pts+=w;
                curr+=w*x;
            }
            //DEBUG(pts); DEBUG(curr);
        }
        cout<<pts<<endl;

    }
}


/*....Abhilash's coding template....*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define all(a) (a).begin(),(a).end()
#define vll vector<ll>
#define fl(i,a,b) for(ll i=a;i<=b;i++)
#define flr(i,a,b) for(ll i=a;i>=b;i--)
#define print(v) for(auto i=v.begin();i!=v.end();i++){cout<<*i<<" ";}cout<<"\n";
#define tr(c,i) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define keep_unique(v) sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); // keeps only unique elements in the vector v
#define test() ll te; cin >> te; while(te--)
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define PI 3.14159265
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int main()
{

    {
        ll n,a,b,k; cin>>n>>a>>b>>k;
        vll v(n); fl(i,0,n-1) cin>>v[i];
        ll d=a+b;
        fl(i,0,n-1)
        {
            v[i]%=d;
        }
        vll ht(d,0);
        fl(i,0,n-1)
        {
            ht[v[i]]++;
        }
        ht.pb(ht[0]);
       // print(ht);
        ll curr=0,x,pts=0;
        for(int i=1;i<=d&&curr<k;i++)
        {
            //cout<<i<<" ";
            if(i<=a)
            {
                pts+=ht[i];
            }
            else
            {
                x=ceil((float)i/(float)a)-1;
                ll w=(k-curr)/x;
                w=min(w,ht[i]);
                pts+=w;
                curr+=w*x;
            }
            //DEBUG(pts); DEBUG(curr);
        }
        cout<<pts<<endl;

    }
}


/*....Abhilash's coding template....*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define all(a) (a).begin(),(a).end()
#define vll vector<ll>
#define fl(i,a,b) for(ll i=a;i<=b;i++)
#define flr(i,a,b) for(ll i=a;i>=b;i--)
#define print(v) for(auto i=v.begin();i!=v.end();i++){cout<<*i<<" ";}cout<<"\n";
#define tr(c,i) for(decltype((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define keep_unique(v) sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); // keeps only unique elements in the vector v
#define test() ll te; cin >> te; while(te--)
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define PI 3.14159265
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int main()
{
    fast;
    {
        ll n,a,b,k,pts=0; cin>>n>>a>>b>>k;
        vll v(n); fl(i,0,n-1) cin>>v[i];
        ll d=a+b;
        fl(i,0,n-1)
        {
            v[i]%=d;
            if(v[i]==0) v[i]=d;
        }
        sort(all(v));
       // print(v);
        fl(i,0,n-1)
        {
            if(k>0)
            {
                ll x;
                x=ceil((float)((float)(v[i])/(float)a))-1;
                if(x<=k)
                {
                    pts++;
                    k-=x;
                }
            }
        }

        cout<<pts<<endl;

    }
}


/*....Abhilash's coding template....*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define all(a) (a).begin(),(a).end()
#define vll vector<ll>
#define fl(i,a,b) for(ll i=a;i<=b;i++)
#define flr(i,a,b) for(ll i=a;i>=b;i--)
#define print(v) for(auto i=v.begin();i!=v.end();i++){cout<<*i<<" ";}cout<<"\n";
#define tr(c,i) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define keep_unique(v) sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); // keeps only unique elements in the vector v
#define test() ll te; cin >> te; while(te--)
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define PI 3.14159265
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int main()
{

    {
        ll n,a,b,k; cin>>n>>a>>b>>k;
        vll v(n); fl(i,0,n-1) cin>>v[i];
        ll d=a+b;
        fl(i,0,n-1)
        {
            v[i]%=d;
        }
        vll ht(d,0);
        fl(i,0,n-1)
        {
            ht[v[i]]++;
        }
        ht.pb(ht[0]);
       // print(ht);
        ll curr=0,x,pts=0;
        for(int i=1;i<=d&&curr<k;i++)
        {
            //cout<<i<<" ";
            if(i<=a)
            {
                pts+=ht[i];
            }
            else
            {
                x=ceil((float)i/(float)a)-1;
                ll w=k/x;
                w=min(w,ht[i]);
                pts+=w;
                curr+=w*x;
            }
            //DEBUG(pts); DEBUG(curr);
        }
        cout<<pts<<endl;

    }
}


/*....Abhilash's coding template....*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define all(a) (a).begin(),(a).end()
#define vll vector<ll>
#define fl(i,a,b) for(ll i=a;i<=b;i++)
#define flr(i,a,b) for(ll i=a;i>=b;i--)
#define print(v) for(auto i=v.begin();i!=v.end();i++){cout<<*i<<" ";}cout<<"\n";
#define tr(c,i) for(decltype((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define keep_unique(v) sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); // keeps only unique elements in the vector v
#define test() ll te; cin >> te; while(te--)
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define PI 3.14159265
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int main()
{
    fast;
    {
        ll n,a,b,k; cin>>n>>a>>b>>k;
        vll v(n); fl(i,0,n-1) cin>>v[i];
        ll d=a+b;
        fl(i,0,n-1)
        {
            v[i]%=d;
        }
        //vll ht(d,0);
        map<ll,ll> ht;
        fl(i,0,n-1)
        {
            ht[v[i]]++;
        }
        ht[a+b]=ht[0];
       // print(ht);
        ll curr=0,x,pts=0;
        //for(int i=1;i<=d&&curr<k;i++)
        tr(ht,i)
        {
            //cout<<i<<" ";
            if(i->ff!=0)
            {
                if(i->ff<=a)
                {
                    pts+=ht[i->ff];
                }
                else
                {
                    x=ceil((float)i->ff/(float)a)-1;
                    if(x!=0)
                    {
                        ll w=(k-curr)/x;
                        w=min(w,ht[i->ff]);
                        pts+=w;
                        curr+=w*x;
                    }
                    else
                    {
                        pts++;
                        curr++;
                    }
                }
            }
            //DEBUG(pts); DEBUG(curr);
        }
        cout<<pts<<endl;

    }
}


/*....Abhilash's coding template....*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define all(a) (a).begin(),(a).end()
#define vll vector<ll>
#define fl(i,a,b) for(ll i=a;i<=b;i++)
#define flr(i,a,b) for(ll i=a;i>=b;i--)
#define print(v) for(auto i=v.begin();i!=v.end();i++){cout<<*i<<" ";}cout<<"\n";
#define tr(c,i) for(decltype((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define keep_unique(v) sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); // keeps only unique elements in the vector v
#define test() ll te; cin >> te; while(te--)
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define PI 3.14159265
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int main()
{
    fast;
    {
        ll n,a,b,k; cin>>n>>a>>b>>k;
        vll v(n); fl(i,0,n-1) cin>>v[i];
        ll d=a+b;
        fl(i,0,n-1)
        {
            v[i]%=d;
        }
        //vll ht(d,0);
        map<ll,ll> ht;
        fl(i,0,n-1)
        {
            ht[v[i]]++;
        }
        ht[a+b]=ht[0];
       // print(ht);
        ll curr=0,x,pts=0;
        //for(int i=1;i<=d&&curr<k;i++)
        tr(ht,i)
        {
            //cout<<i<<" ";
            if(i->ff!=0&&curr<k)
            {
                if(i->ff<=a)
                {
                    pts+=ht[i->ff];
                }
                else
                {
                    x=ceil((float)(i->ff)/(float)a)-1;
                    ll w=(k-curr)/x;
                    w=min(w,ht[i->ff]);
                    pts+=w;
                    curr+=w*x;

                }
            }
            //DEBUG(pts); DEBUG(curr);
        }
        cout<<pts<<endl;

    }
}


/*....Abhilash's coding template....*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define all(a) (a).begin(),(a).end()
#define vll vector<ll>
#define fl(i,a,b) for(ll i=a;i<=b;i++)
#define flr(i,a,b) for(ll i=a;i>=b;i--)
#define print(v) for(auto i=v.begin();i!=v.end();i++){cout<<*i<<" ";}cout<<"\n";
#define tr(c,i) for(decltype((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define keep_unique(v) sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); // keeps only unique elements in the vector v
#define test() ll te; cin >> te; while(te--)
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define PI 3.14159265
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int main()
{
    fast;
    {
        ll n,a,b,k; cin>>n>>a>>b>>k;
        vll v(n); fl(i,0,n-1) cin>>v[i];
        ll d=a+b;
        fl(i,0,n-1)
        {
            v[i]%=d;
        }
        //vll ht(d,0);
        map<ll,ll> ht;
        fl(i,0,n-1)
        {
            ht[v[i]]++;
        }
        ht[a+b]=ht[0];
       // print(ht);
        ll curr=0,x,pts=0;
        //for(int i=1;i<=d&&curr<k;i++)
        tr(ht,i)
        {
            //cout<<i<<" ";
            if(i->ff>0&&curr<k)
            {
                if(i->ff<=a)
                {
                    pts+=ht[i->ff];
                }
                else
                {
                    x=ceil((float)((float)(i->ff)/(float)a))-1;
                    ll w=(k-curr)/x;
                    w=min(w,ht[i->ff]);
                    pts+=w;
                    curr+=w*x;

                }
            }
            //DEBUG(pts); DEBUG(curr);
        }
        cout<<pts<<endl;

    }
}


/*....Abhilash's coding template....*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define all(a) (a).begin(),(a).end()
#define vll vector<ll>
#define fl(i,a,b) for(ll i=a;i<=b;i++)
#define flr(i,a,b) for(ll i=a;i>=b;i--)
#define print(v) for(auto i=v.begin();i!=v.end();i++){cout<<*i<<" ";}cout<<"\n";
#define tr(c,i) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define keep_unique(v) sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); // keeps only unique elements in the vector v
#define test() ll te; cin >> te; while(te--)
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define PI 3.14159265
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int main()
{

    {
        ll n,a,b,k; cin>>n>>a>>b>>k;
        vll v(n); fl(i,0,n-1) cin>>v[i];
        ll d=a+b;
        fl(i,0,n-1)
        {
            v[i]%=d;
        }
        //vll ht(d,0);
        unordered_map<ll,ll> ht;
        fl(i,0,n-1)
        {
            ht[v[i]]++;
        }
        ht[a+b]=ht[0];
       // print(ht);
        ll curr=0,x,pts=0;
        for(int i=1;i<=d&&curr<k;i++)
        {
            //cout<<i<<" ";
            if(i<=a)
            {
                pts+=ht[i];
            }
            else
            {
                x=ceil((float)i/(float)a)-1;
                ll w=(k-curr)/x;
                w=min(w,ht[i]);
                pts+=w;
                curr+=w*x;
            }
            //DEBUG(pts); DEBUG(curr);
        }
        cout<<pts<<endl;

    }
}


/*....Abhilash's coding template....*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define all(a) (a).begin(),(a).end()
#define vll vector<ll>
#define fl(i,a,b) for(ll i=a;i<=b;i++)
#define flr(i,a,b) for(ll i=a;i>=b;i--)
#define print(v) for(auto i=v.begin();i!=v.end();i++){cout<<*i<<" ";}cout<<"\n";
#define tr(c,i) for(decltype((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define keep_unique(v) sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); // keeps only unique elements in the vector v
#define test() ll te; cin >> te; while(te--)
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define PI 3.14159265
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int main()
{
    fast;
    {
        ll n,a,b,k; cin>>n>>a>>b>>k;
        vll v(n); fl(i,0,n-1) cin>>v[i];
        ll d=a+b;
        fl(i,0,n-1)
        {
            v[i]%=d;
        }
        //vll ht(d,0);
        map<ll,ll> ht;
        fl(i,0,n-1)
        {
            ht[v[i]]++;
        }
        ht[a+b]=ht[0];
       // print(ht);
        ll curr=0,x,pts=0;
        //for(int i=1;i<=d&&curr<k;i++)
        tr(ht,i)
        {
            //cout<<i<<" ";
            if(i->ff!=0)
            {
                if(i->ff<=a)
                {
                    pts+=ht[i->ff];
                }
                else
                {
                    x=ceil((float)i->ff/(float)a)-1;
                    ll w=(k-curr)/x;
                    w=min(w,ht[i->ff]);
                    pts+=w;
                    curr+=w*x;
                }
            }
            //DEBUG(pts); DEBUG(curr);
        }
        cout<<pts<<endl;

    }
}


/*....Abhilash's coding template....*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define all(a) (a).begin(),(a).end()
#define vll vector<ll>
#define fl(i,a,b) for(ll i=a;i<=b;i++)
#define flr(i,a,b) for(ll i=a;i>=b;i--)
#define print(v) for(auto i=v.begin();i!=v.end();i++){cout<<*i<<" ";}cout<<"\n";
#define tr(c,i) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define keep_unique(v) sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); // keeps only unique elements in the vector v
#define test() ll te; cin >> te; while(te--)
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define PI 3.14159265
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int main()
{

    {
        ll n,a,b,k; cin>>n>>a>>b>>k;
        vll v(n); fl(i,0,n-1) cin>>v[i];
        ll d=a+b;
        fl(i,0,n-1)
        {
            v[i]%=d;
        }
        vll ht(d,0);
        fl(i,0,n-1)
        {
            ht[v[i]]++;
        }
        ht.pb(ht[0]);
        print(ht);
        ll curr=0,x,pts=0;
        for(int i=1;i<=d&&curr<k;i++)
        {
            //cout<<i<<" ";
            if(i<=a)
            {
                pts+=ht[i];
            }
            else
            {
                x=ceil((float)i/(float)a)-1;
                ll w=k/x;
                w=min(w,ht[i]);
                pts+=w;
                curr+=w*x;
            }
            //DEBUG(pts); DEBUG(curr);
        }
        cout<<pts<<endl;

    }
}


/*....Abhilash's coding template....*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define all(a) (a).begin(),(a).end()
#define vll vector<ll>
#define fl(i,a,b) for(ll i=a;i<=b;i++)
#define flr(i,a,b) for(ll i=a;i>=b;i--)
#define print(v) for(auto i=v.begin();i!=v.end();i++){cout<<*i<<" ";}cout<<"\n";
#define tr(c,i) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define keep_unique(v) sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); // keeps only unique elements in the vector v
#define test() ll te; cin >> te; while(te--)
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define PI 3.14159265
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

int main()
{

    {
        ll n,a,b,k; cin>>n>>a>>b>>k;
        vll v(n); fl(i,0,n-1) cin>>v[i];
        ll d=a+b;
        fl(i,0,n-1)
        {
            v[i]%=d;
        }
        //vll ht(d,0);
        unordered_map<ll,ll> ht;
        fl(i,0,n-1)
        {
            ht[v[i]]++;
        }
        ht.pb(ht[0]);
       // print(ht);
        ll curr=0,x,pts=0;
        for(int i=1;i<=d&&curr<k;i++)
        {
            //cout<<i<<" ";
            if(i<=a)
            {
                pts+=ht[i];
            }
            else
            {
                x=ceil((float)i/(float)a)-1;
                ll w=(k-curr)/x;
                w=min(w,ht[i]);
                pts+=w;
                curr+=w*x;
            }
            //DEBUG(pts); DEBUG(curr);
        }
        cout<<pts<<endl;

    }
}


/* Author : Mohd Athar */
#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll int n,a,b,k;
    cin>>n>>a>>b>>k;

    ll int h[n];
    vector<ll int >dp;
    ll int div = (a+b);
    ll int res = 0;
    for(int i = 0 ; i<n ; i++){
        cin>>h[i];
        int flag = 0;
        h[i] = h[i]%div;
        if(h[i] == 0){
            dp.push_back(h[i] + div )
        }
        else{

            h[i] = ((h[i] + a - 1) / a) - 1;
            dp.emplace_back(h[i]);

        }

    }

    sort(dp.begin() , dp.end());
    // for(int i = 0 ; i<dp.size() ; i++)
    //     cout<<dp[i]<<" ";
    int i = 0;
    while(k >= dp[i] && i < dp.size()){
        k -= dp[i];
        res++;
        i++;
    }

    cout<<res<<"\n";

    return 0;
}


/* Author : Mohd Athar */
#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll int n,a,b,k;
    cin>>n>>a>>b>>k;

    ll int h[n];
    vector<ll int >dp;
    ll int div = (a+b);
    ll int res = 0;
    for(int i = 0 ; i<n ; i++){
        cin>>h[i];
        int flag = 0;
        h[i] = h[i]%div;
        if(h[i] == 0)
            h[i] += div;

        h[i] = ((h[i] + a - 1) / a) - 1;
        dp.emplace_back(h[i]);

    }

    sort(dp.begin() , dp.end());
    // for(int i = 0 ; i<dp.size() ; i++)
    //     cout<<dp[i]<<" ";

   for(int i = 0 ; i<n ; i++){
    if(k < dp[i])
        break;

        k -= dp[i];
        res++;
    }

    cout<<res<<"\n";

    return 0;
}


/* Author : Mohd Athar */
#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll int n,a,b,k;
    cin>>n>>a>>b>>k;

    ll int h[n];
    vector<ll int >dp;
    ll int div = (a+b);
    ll int res = 0;
    for(int i = 0 ; i<n ; i++){
        cin>>h[i];
        if(h[i] % div <= a && h[i]%div != 0){
            res++;
        }
        else{
            ll int count = 0;
            while(h[i] % div > a || h[i]%div == 0){
                h[i] -= a;
                count++;
            }
            dp.emplace_back(count);
        }
    }

    sort(dp.begin() , dp.end());
    // for(int i = 0 ; i<dp.size() ; i++)
    //     cout<<dp[i]<<" ";
    int i = 0;
    while(k >= dp[i] && i < dp.size()){
        k -= dp[i];
        res++;
        i++;
    }

    cout<<res<<"\n";

    return 0;
}


/* Author : Mohd Athar */
#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll int n,a,b,k;
    cin>>n>>a>>b>>k;

    ll int h[n];
    vector<ll int >dp;
    ll int div = (a+b);
    ll int res = 0;
    for(int i = 0 ; i<n ; i++){
        cin>>h[i];
        int flag = 0;
        if(h[i] % div <= a && h[i]%div != 0){
            res++;
        }
        else{
          if(h[i] <= div)
            dp.emplace_back(1);
          else{
                ll int count = 0;
                ll int x = h[i] - div;
                ll int ad = x/a;
                if(x%a != 0)
                    ad++;

                count += ad - 1;
                dp.emplace_back(count);
            }
        }
    }

    sort(dp.begin() , dp.end());
    // for(int i = 0 ; i<dp.size() ; i++)
    //     cout<<dp[i]<<" ";
    int i = 0;
    while(k >= dp[i] && i < dp.size()){
        k -= dp[i];
        res++;
        i++;
    }

    cout<<res<<"\n";

    return 0;
}


/* Author : Mohd Athar */
#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll int n,a,b,k;
    cin>>n>>a>>b>>k;

    ll int h[n];
    vector<ll int >dp;
    ll int div = (a+b);
    ll int res = 0;
    for(int i = 0 ; i<n ; i++){
        cin>>h[i];
        int flag = 0;
        if(h[i] % div <= a && h[i]%div != 0){
            res++;
        }
        else{
          if(h[i] <= div)
            dp.emplace_back(1);
          else{
                ll int count = 0;
                ll int x = h[i] - div;
                ll int ad = x/a;
                // if(x%a != 0)
                //     ad++;

                count += ad - 1;
                dp.emplace_back(count);
            }
        }
    }

    sort(dp.begin() , dp.end());
    // for(int i = 0 ; i<dp.size() ; i++)
    //     cout<<dp[i]<<" ";
    int i = 0;
    while(k >= dp[i] && i < dp.size()){
        k -= dp[i];
        res++;
        i++;
    }

    cout<<res<<"\n";

    return 0;
}


/* Author : Mohd Athar */
#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll int n,a,b,k;
    cin>>n>>a>>b>>k;

    ll int h[n];
    vector<ll int >dp;
    ll int div = (a+b);
    ll int res = 0;
    for(int i = 0 ; i<n ; i++){
        cin>>h[i];
        int flag = 0;
        if(h[i] % div <= a && h[i]%div != 0){
            res++;
        }
        else{
            ll int count = 0;
            while(h[i] % div > a || h[i]%div == 0){
                h[i] -= a;
                count++;
                if(count > k){
                    flag = 1;
                    break;
                }
            }
            if(flag == 0)
                dp.emplace_back(count);
        }
    }

    sort(dp.begin() , dp.end());
    // for(int i = 0 ; i<dp.size() ; i++)
    //     cout<<dp[i]<<" ";
    int i = 0;
    while(k >= dp[i] && i < dp.size()){
        k -= dp[i];
        res++;
        i++;
    }

    cout<<res<<"\n";

    return 0;
}


/* Author : Mohd Athar */
#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll int n,a,b,k;
    cin>>n>>a>>b>>k;

    ll int h[n];
    vector<ll int >dp;
    ll int div = (a+b);
    ll int res = 0;
    for(int i = 0 ; i<n ; i++){
        cin>>h[i];
        int flag = 0;
        h[i] = h[i]%div;
        if(h[i] == 0){
            dp.push_back(h[i] + div );
        }
        else{

            h[i] = ((h[i] + a - 1) / a) - 1;
            dp.emplace_back(h[i]);

        }

    }

    sort(dp.begin() , dp.end());
    // for(int i = 0 ; i<dp.size() ; i++)
    //     cout<<dp[i]<<" ";
    int i = 0;
    while(k >= dp[i] && i < dp.size()){
        k -= dp[i];
        res++;
        i++;
    }

    cout<<res<<"\n";

    return 0;
}


/* Author : Mohd Athar */
#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll int n,a,b,k;
    cin>>n>>a>>b>>k;

    ll int h[n];
    vector<ll int >dp;
    ll int div = (a+b);
    ll int res = 0;
    for(int i = 0 ; i<n ; i++){ // Approach : It is very clear that wew can find out h%(a+b) can tell us
        cin>>h[i];      // which person would be beating monster if we dont skip any chance of b
        int flag = 0;   // Now what we do we take mod with every h[i],
        h[i] = h[i]%div;// see if h[i] is not divisible means we have to decide if we can get point without skipping chance of b
        if(h[i] == 0)// we can see if the mod comes if it is smaller than a we dont need to skip
            h[i] += div;    // but if its greater we need 1 skip atmost, and we can finmd this out
        // by seeing how many a's can fill last place - 1 , we subtract 1 because we also added a-1 to it
        h[i] = ((h[i] + a - 1) / a) - 1;// we adden a-1 in mod because if its smaller than a it will come 1 and we subtract 1 reult is 0
        dp.emplace_back(h[i]);// but if it is greater than 1 it could be possible it is not compeletly divisible by a
        // so we make mod more bigger that after dividing we get 1 extra and then subtract it , and we do this by adding a-1
    // anone case is where mod comes out to be 0 , for this we take last chance which is actually nothing but div(a+b)
    }// and we do same for this , we see with how many a's we can fill this chance
    // so we store how many a's we need to fill a chance and sort it so to use minimum k and beat maximum monster as possible
    sort(dp.begin() , dp.end());
    // for(int i = 0 ; i<dp.size() ; i++)
    //     cout<<dp[i]<<" ";

   for(int i = 0 ; i<n ; i++){
    if(k < dp[i])
        break;

        k -= dp[i];
        res++;
    }

    cout<<res<<"\n";

    return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define lld long long
int main()
{
    lld n, a, b, k;
    cin>> n>> a>> b>> k;
    vector<lld> v; lld cnt = 0;
    for(int i = 0; i< n; i++)
    {
        int num; cin>> num;
        if(num%(a+b)!=0)
        v.push_back(num%(a+b));
        else cnt++ ;
    }
    for(int i = 0; i< cnt ; i++ ) v.push_back(0);
    //for(auto i: v) cout<<i<<" ";
        lld ans = 0;
    for(int i = 0;i< n; i++ )
    {
        if(v[i]==0)
            v[i]+=(a+b);
        v[i]-= a;
        if(v[i]<=0)
            ans++;
        else
        {
            if((v[i]/a + ((v[i]% a)!=0)) <= k)
            {
                k-= v[i]/a + (v[i]% a)!=0;
                ans++;
            }
        }
    }
    cout<< ans << endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n,a,b,k;
	cin>> n>> a>> b>> k;
	vector<int> v;  int cnt = 0;
	for(int i = 0; i< n; i++ )
	{
		int power; cin>> power;
		if(power%(a+b)!=0)
		v.push_back(power%(a+b));
		else cnt++;
	}
	sort(v.begin(),v.end());
	for(int i = 0; i< cnt ; i++ ) v.push_back(0);
	//for(auto i: v) cout<< i<<" ";
		int ans = 0;
	for(int i = 0; i< n; i++ )
	{
		if(v[i] > a || v[i]==0)
		{
			if(v[i]==0) v[i]+=b;
			a= 2*a;
			if(v[i]%a==0 && v[i]/a <= k)
			{
				ans++; k-= v[i]/a;
			}
			else if(v[i]%a!=0 && v[i]/a + 1 <= k)
			{
				ans++; k-= v[i]/a +1;
			}
		}
		else ans++;
	}
	cout<< ans << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn = 200010;
int n, a, b, k;
bool comp(int x, int y) {
	if(x/ a != x/b ) return x/a < x/ b;
	if(x%a==0) return x/a < x/b;
	return x/b < x/a;
}
int main() {

	cin >> n >> a >> b >> k;
	vector<int> power;
	for(int i = 0; i< n; i++) {
		int p;
		cin >> p;
		p %= (a+b);
		if(p <= a && p!= 0) p = 0;
		else if(p==0) p = b;
		else p-=a;
		power.push_back(p);
	}
	int cnt = 0;
	sort(power.begin(),power.end());
	for(auto i: power) {
		if(i > 0) {
			int val = i/ a + (i%a!=0);
			k -= val;
			if(k>=0) cnt++;
		}
		else cnt++;
	}
	cout << cnt << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std ;

int main()
{
    int n, a, b, k;
    cin>> n>> a>> b>> k;
    vector<int> v; int cnt = 0;
    for(int i = 0; i< n; i++)
    {
        int num; cin>> num;
        if(num%(a+b)!=0)
        v.push_back(num%(a+b));
        else cnt++ ;
    }
    for(int i = 0; i< cnt ; i++ ) v.push_back(0);
    //for(auto i: v) cout<<i<<" ";
        int ans = 0;
    for(int i = 0;i< n; i++ )
    {
        if(v[i]==0)
            v[i]+=(a+b);
        v[i]-= a;
        if(v[i]<=0)
            ans++;
        else
        {
            if((v[i]/a + ((v[i]% a)!=0)) <= k)
            {
                k-= v[i]/a + (v[i]% a)!=0;
                ans++;
            }
        }
    }
    cout<< ans << endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const long long maxn = 200010;
long long n, a, b, k;
int main() {

	cin >> n >> a >> b >> k;
	vector<long long> power;
	for(long long i = 0; i< n; i++) {
		long long p;
		cin >> p;
		p %= (a+b);
		if(p <= a && p!= 0) p = 0;
		else if(p==0) p = b;
		else p-=a;
		power.push_back(p);
	}
	long long cnt = 0;
	sort(power.begin(),power.end());
	for(auto i: power) {
		if(i > 0) {
			long long val = i/ a + (i%a!=0);
			k -= val;
			if(k>=0) cnt++;
		}
		else cnt++;
	}
	cout << cnt << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const long long maxn = 200010;
long long n, a, b, k;
bool comp(long long x, long long y) {
	if(x/ a != x/b ) return x/a < x/ b;
	if(x%a==0) return x/a < x/b;
	return x/b < x/a;
}
int main() {

	cin >> n >> a >> b >> k;
	vector<long long> power;
	for(long long i = 0; i< n; i++) {
		long long p;
		cin >> p;
		p %= (a+b);
		if(p <= a && p!= 0) p = 0;
		else if(p==0) p = b;
		else p-=a;
		power.push_back(p);
	}
	long long cnt = 0;
	sort(power.begin(),power.end());
	for(auto i: power) {
		if(i > 0) {
			long long val = i/ a + (i%a!=0);
			k -= val;
			if(k>=0) cnt++;
		}
		else cnt++;
	}
	cout << cnt << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

map<ll,ll> exmoves;

int main(){
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll mons[n];
    ll tot = a+b;
    int cnt = 0;
    for(int i=0;i<n;i++)
        cin>>mons[i];
    ///sort(mons,mons+n);
    ///ll mx = 0;
    for(int i=0;i<n;i++){
        ll mod = mons[i]%tot;
        if(mod>0 && mod<=a){
            cnt++;
        }
        else{
            ll x;
            if(a<mod) x = ceil((mod-a)*1.0/a);
            else x = ceil(b*1.0/a);
            exmoves[x]++;
            ///mx = max(mx,x);
        }
    }
    for(auto it:exmoves){
        ll i = it.first;
        ll x = it.second;
        if(x*i<=k){
            cnt += x;
            k -= x*i;
        }
        else{
            cnt += (k/i);
            k = 0;
        }
    }
    cout<<cnt<<endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

const int N = 4e8+8;
int exmoves[N];

int main(){
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll mons[n];
    ll tot = a+b;
    int cnt = 0;
    for(int i=0;i<n;i++)
        cin>>mons[i];
    ///sort(mons,mons+n);
    ll mx = 0;
    for(int i=0;i<n;i++){
        ll mod = mons[i]%tot;
        if(mod>0 && mod<=a){
            cnt++;
        }
        else{
            ll x;
            if(a<mod) x = ceil((mod-a)*1.0/a);
            else x = ceil(b*1.0/a);
            exmoves[x]++;
            mx = max(mx,x);
        }
    }
    for(int i=1;i<=mx && k>0;i++){
        if(exmoves[i]){
            if(exmoves[i]*i<=k){
                cnt += exmoves[i];
                k -= exmoves[i]*i;
            }
            else{
                cnt += (k/i);
                k = 0;
            }
        }
    }
    cout<<cnt<<endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

const int N = 1e7+8;
int exmoves[N];

int main(){
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll mons[n];
    ll tot = a+b;
    int cnt = 0;
    for(int i=0;i<n;i++)
        cin>>mons[i];
    ///sort(mons,mons+n);
    ll mx = 0;
    for(int i=0;i<n;i++){
        ll mod = mons[i]%tot;
        if(mod>0 && mod<=a){
            cnt++;
        }
        else{
            ll x;
            if(a<mod) x = ceil((mod-a)*1.0/a);
            else x = ceil(b*1.0/a);
            exmoves[x]++;
            mx = max(mx,x);
        }
    }
    for(int i=1;i<=mx && k>0;i++){
        if(exmoves[i]){
            if(exmoves[i]*i<=k){
                cnt += exmoves[i];
                k -= exmoves[i]*i;
            }
            else{
                cnt += (k/i);
                k = 0;
            }
        }
    }
    cout<<cnt<<endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

unordered_map<ll,ll> exmoves;

int main(){
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll mons[n];
    ll tot = a+b;
    int cnt = 0;
    for(int i=0;i<n;i++)
        cin>>mons[i];
    ///sort(mons,mons+n);
    ll mx = 0;
    for(int i=0;i<n;i++){
        ll mod = mons[i]%tot;
        if(mod>0 && mod<=a){
            cnt++;
        }
        else{
            ll x;
            if(a<mod) x = ceil((mod-a)*1.0/a);
            else x = ceil(b*1.0/a);
            exmoves[x]++;
            mx = max(mx,x);
        }
    }
    for(int i=1;i<=mx && k>0;i++){
        if(exmoves[i]){
            if(exmoves[i]*i<=k){
                cnt += exmoves[i];
                k -= exmoves[i]*i;
            }
            else{
                cnt += (k/i);
                k = 0;
            }
        }
    }
    cout<<cnt<<endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

map<ll,ll> exmoves;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll mons[n];
    ll tot = a+b;
    int cnt = 0;
    for(int i=0;i<n;i++)
        cin>>mons[i];
    for(int i=0;i<n;i++){
        ll mod = mons[i]%tot;
        if(mod>0 && mod<=a){
            cnt++;
        }
        else{
            ll x;
            if(a<mod) x = ceil((mod-a)*1.0/a);
            else x = ceil(b*1.0/a);
            exmoves[x]++;
        }
    }
    for(auto it:exmoves){
        ll i = it.first;
        ll x = it.second;
        if(x*i<=k){
            cnt += x;
            k -= x*i;
        }
        else{
            cnt += (k/i);
            k = 0;
        }
    }
    cout<<cnt<<endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

map<ll,ll> exmoves;

int main(){
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll mons[n];
    ll tot = a+b;
    int cnt = 0;
    for(int i=0;i<n;i++)
        cin>>mons[i];
    ///sort(mons,mons+n);
    ll mx = 0;
    for(int i=0;i<n;i++){
        ll mod = mons[i]%tot;
        if(mod>0 && mod<=a){
            cnt++;
        }
        else{
            ll x;
            if(a<mod) x = ceil((mod-a)*1.0/a);
            else x = ceil(b*1.0/a);
            exmoves[x]++;
            mx = max(mx,x);
        }
    }
    for(int i=1;i<=mx && k>0;i++){
        if(exmoves[i]){
            if(exmoves[i]*i<=k){
                cnt += exmoves[i];
                k -= exmoves[i]*i;
            }
            else{
                cnt += (k/i);
                k = 0;
            }
        }
    }
    cout<<cnt<<endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

const int N = 1e8+8;
int exmoves[N];

int main(){
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll mons[n];
    ll tot = a+b;
    int cnt = 0;
    for(int i=0;i<n;i++)
        cin>>mons[i];
    ///sort(mons,mons+n);
    ll mx = 0;
    for(int i=0;i<n;i++){
        ll mod = mons[i]%tot;
        if(mod>0 && mod<=a){
            cnt++;
        }
        else{
            ll x;
            if(a<mod) x = ceil((mod-a)*1.0/a);
            else x = ceil(b*1.0/a);
            exmoves[x]++;
            mx = max(mx,x);
        }
    }
    for(int i=1;i<=mx && k>0;i++){
        if(exmoves[i]){
            if(exmoves[i]*i<=k){
                cnt += exmoves[i];
                k -= exmoves[i]*i;
            }
            else{
                cnt += (k/i);
                k = 0;
            }
        }
    }
    cout<<cnt<<endl;

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll ar[n];
    for(ll i=0;i<n;i++){
        cin>>ar[i];
        ar[i] %= (a+b);
        if(ar[i]==0)
            ar[i] = a+b;
        ar[i] -= a;
    }
    sort(ar,ar+n);
    ll cnt = 0;
    for(ll i=0;i<n;i++){
        if(ar[i]<=0)
            cnt++;
        else{
            while(k--){
                ar[i]-=a;
                if(ar[i]<=0){
                    cnt++;
                    break;
                }
            }
        }
    }
    cout<<cnt<<"\n";
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll ar[n];
    for(ll i=0;i<n;i++){
        cin>>ar[i];
        ar[i] %= (a+b);
        if(ar[i]==0)
            ar[i] = a+b;
        ar[i] -= a;
    }
    sort(ar,ar+n);
    ll cnt = 0;
    for(ll i=0;i<n;i++){
        if(ar[i]<=0)
            cnt++;
        else if(k*a>=ar[i]){
            while(k--){
                ar[i]-=a;
                if(ar[i]<=0){
                    cnt++;
                    break;
                }
            }
        }
    }
    cout<<cnt<<"\n";
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll ar[n];
    for(ll i=0;i<n;i++){
        cin>>ar[i];
        ar[i] %= (a+b);
        if(ar[i]==0)
            ar[i] = a+b;
        ar[i] -= a;
    }
    sort(ar,ar+n);
    ll cnt = 0;
    for(ll i=0;i<n;i++){
        if(ar[i]<=0)
            cnt++;
        else if(k*a>=ar[i]){
            int modd = ar[i]%a;
            k -= modd;
            if(k>=0)
                cnt++;
        }
    }
    cout<<cnt<<"\n";
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll ar[n];
    for(ll i=0;i<n;i++){
        cin>>ar[i];
        ar[i] %= (a+b);
        if(ar[i]==0)
            ar[i] = a+b;
        ar[i] -= a;
    }
    sort(ar,ar+n);
    ll cnt = 0;
    for(ll i=0;i<n;i++){
        if(ar[i]<=0)
            cnt++;
        else if(k*a>=ar[i]){
            int modd = ar[i]%a;
            int temp = ar[i]/a + 1;
            k -= temp;
            if(k<=0){
                cnt++;
                break;
            }
            else
                cnt++;
        }
    }
    cout<<cnt<<"\n";
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll ar[n];
    for(ll i=0;i<n;i++){
        cin>>ar[i];
        ar[i] %= (a+b);
        if(ar[i]==0)
            ar[i] = a+b;
        ar[i] -= a;
    }
    sort(ar,ar+n);
    ll cnt = 0;
    for(ll i=0;i<n;i++){
        if(ar[i]<=0)
            cnt++;
        else if(k*a>=ar[i]){
            int temp = ar[i]/a;
            if((ar[i]%a)!=0)
                temp += 1;
            k -= temp;
            if(k<=0){
                cnt++;
                break;
            }
            else
                cnt++;
        }
        else
            break;
    }
    cout<<cnt<<"\n";
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll ar[n];
    for(ll i=0;i<n;i++){
        cin>>ar[i];
        ar[i] %= (a+b);
        if(ar[i]==0)
            ar[i] = a+b;
        ar[i] -= a;
    }
    sort(ar,ar+n);
    ll cnt = 0;
    for(ll i=0;i<n;i++){
        if(ar[i]<=0)
            cnt++;
        else if(k*a>=ar[i]){
            int temp = ar[i]/a;
            if(ar[i]%2==1)
                temp += 1;
            k -= temp;
            if(k<=0){
                cnt++;
                break;
            }
            else
                cnt++;
        }
    }
    cout<<cnt<<"\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b,k;
    cin>>n>>a>>b>>k;
    int ar[n];
    for(int i=0;i<n;i++){
        cin>>ar[i];
        ar[i] %= (a+b);
        if(ar[i]==0)
            ar[i] = a+b;
        ar[i] -= a;
    }
    sort(ar,ar+n);
    int cnt = 0;
    for(int i=0;i<n;i++){
        if(ar[i]<=0)
            cnt++;
        else{
            while(k--){
                ar[i]-=a;
                if(ar[i]<=0){
                    cnt++;
                    break;
                }
            }
        }
    }
    cout<<cnt<<"\n";
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll ar[n];
    for(ll i=0;i<n;i++){
        cin>>ar[i];
        ar[i] %= (a+b);
        if(ar[i]==0)
            ar[i] = a+b;
        ar[i] -= a;
    }
    sort(ar,ar+n);
    ll cnt = 0;
    for(ll i=0;i<n;i++){
        if(ar[i]<=0)
            cnt++;
        else if(k*a>=ar[i]){
            int temp = ar[i]/a;
            if(ar[i]%2==1)
                temp += 1;
            k -= temp;
            if(k<=0){
                cnt++;
                break;
            }
            else
                cnt++;
        }
        else
            break;
    }
    cout<<cnt<<"\n";
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,a,b,k;
    cin>>n>>a>>b>>k;
    vector<int> v(n,0);
    int t=a+b;
    vector<pair<int,int>> v1;
    for(int i=0;i<n;i++){
        cin>>v[i];
        int z=v[i]%t;
        v1.push_back(make_pair(z,v[i]));
    }
    sort(v1.begin(),v1.end());
    int rr=0;
    for(int i=0;i<v1.size();i++){
        if(v1[i].first==1){
            rr=i;
            break;
        }
    }
    int cnt=0;
    for(int i=rr;i<n;i++){
        if(v[i]%t<=a && v[i]%t!=0){
            cnt++;
        }
        else if(v[i]%t > a && k!=0){
            int cnt1=0;
            int x=v[i]%t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=cnt1-1){
                k=k-(cnt1-1);
                cnt++;
            }

        }
        else if(v[i]%t==0 && k!=0){
            int cnt1=0;
            int x=t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=cnt1-1){
                k=k-(cnt1-1);
                cnt++;
            }
        }
    }
    for(int i=0;i<rr;i++){
        if(v[i]%t<=a && v[i]%t!=0){
            cnt++;
        }
        else if(v[i]%t > a && k!=0){
            int cnt1=0;
            int x=v[i]%t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=cnt1-1){
                k=k-(cnt1-1);
                cnt++;
            }

        }
        else if(v[i]%t==0 && k!=0){
            int cnt1=0;
            int x=t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=cnt1-1){
                k=k-(cnt1-1);
                cnt++;
            }
        }
    }
    cout<<cnt<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,a,b,k;
    cin>>n>>a>>b>>k;
    int t=a+b;
    vector<int> v(n,0);
    vector<pair<int,int>> v1;
    for(int i=0;i<n;i++){
        cin>>v[i];
        int p=v[i]%t;
        v1.push_back(make_pair(p,v[i]));

    }
    if(a<b){
        sort(v1.begin(),v1.end());
    }
    int rr=0;
    for(int i=0;i<v1.size();i++){
        if(v1[i].first==1){
            rr=i;
            break;
        }
    }
    //printf("\n");
    int cnt=0;
    for(int i=rr;i<n;i++){
        int cnt1=0;
        if((v[i]%t)<=a && v[i]<=a){
            cnt++;
            //cout<<"cnt4"<<cnt<<endl;
        }
        else if((v[i]%t)<=a && (v[i]%t!=0)){
            cnt++;
            //cout<<"cnt1"<<cnt<<endl;
        }

        else if(v[i]%t>a && k!=0){
            int z=v[i]%t;
            while(z>0){
                z=z-a;
                cnt1++;
            }
            int zz=cnt1;
            cnt1=cnt1/2;
            if(zz-cnt1<=k){
                k=k-cnt1;
                cnt++;
            }
            //cout<<"cnt2"<<cnt<<endl;
        }
        else if(v[i]%t==0 && k!=0){
            int z=t;
            while(z>0){
                z=z-a;
                cnt1++;
            }
            int zz=cnt1;
            cnt1=cnt1/2;
            if(zz-cnt1<=k){
                k=k-cnt1;
                cnt++;
            }
            //cout<<"cnt3"<<cnt<<endl;
        }
        //cout<<"k=="<<k<<endl;
    }
    for(int i=0;i<rr;i++){
        int cnt1=0;
        if((v[i]%t)<=a && v[i]<=a){
            cnt++;
            //cout<<"cnt4"<<cnt<<endl;
        }
        else if((v[i]%t)<=a && (v[i]%t!=0)){
            cnt++;
            //cout<<"cnt1"<<cnt<<endl;
        }

        else if(v[i]%t>a && k!=0){
            int z=v[i]%t;
            while(z>0){
                z=z-a;
                cnt1++;
            }
            int zz=cnt1;
            cnt1=cnt1/2;
            if(zz-cnt1<=k){
                k=k-cnt1;
                cnt++;
            }
            //cout<<"cnt2"<<cnt<<endl;
        }
        else if(v[i]%t==0 && k!=0){
            int z=t;
            while(z>0){
                z=z-a;
                cnt1++;
            }
            int zz=cnt1;
            cnt1=cnt1/2;
            if(zz-cnt1<=k){
                k=k-cnt1;
                cnt++;
            }
            //cout<<"cnt3"<<cnt<<endl;
        }
        //cout<<"k=="<<k<<endl;
    }
    cout<<cnt<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,a,b,k;
    cin>>n>>a>>b>>k;
    int t=a+b;
    vector<int> v(n,0);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    sort(v.begin(),v.end());
    //printf("\n");
    int cnt=0;
    for(int i=0;i<n;i++){
        int cnt1=0;
        if((v[i]%t)<=a && v[i]<=a){
            cnt++;
            //cout<<"cnt4"<<cnt<<endl;
        }
        else if((v[i]%t)<=a && (v[i]%t!=0)){
            cnt++;
            //cout<<"cnt1"<<cnt<<endl;
        }

        else if(v[i]%t>a && k!=0){
            int z=v[i]%t;
            while(z>0){
                z=z-a;
                cnt1++;
            }
            cnt1=cnt1/2;
            if(cnt1<=k){
                k=k-cnt1;
                cnt++;
            }
            //cout<<"cnt2"<<cnt<<endl;
        }
        else if(v[i]%t==0 && k!=0){
            int z=t;
            while(z>0){
                z=z-a;
                cnt1++;
            }
            int zz=cnt1;
            cnt1=cnt1/2;
            if(zz-cnt1<=k){
                k=k-cnt1;
                cnt++;
            }
            //cout<<"cnt3"<<cnt<<endl;
        }
        //cout<<"k=="<<k<<endl;
    }
    cout<<cnt<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int n,a,b,k;
    cin>>n>>a>>b>>k;
    vector<long long int> v(n,0);
    long long int t=a+b;
    for(int i=0;i<n;i++){
        cin>>v[i];
        v[i]=((v[i]-1)%(t))/a;
    }
    sort(v.begin(),v.end());
    long long int h=0,i;
    for(i=0;i<n;i++){
        k=k-v[i];
        if(k<0){
            break;
        }
    }
    cout<<i<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int n,a,b,k;
    cin>>n>>a>>b>>k;
    vector<long long int> v(n,0);
    long long int t=a+b;
    vector<pair<long long int,long long int>> v1;
    for(long long int i=0;i<n;i++){
        cin>>v[i];
        long long int z=v[i]%t;
        v1.push_back(make_pair(z,v[i]));
    }
    sort(v1.begin(),v1.end());
    long long int rr=0;
    for(long long int i=0;i<v1.size();i++){
        if(v1[i].first==1){
            rr=i;
            break;
        }
    }
    long long int cnt=0;
    for(long long int i=rr;i<n;i++){
        if(v1[i].second%t<=a && v1[i].second%t!=0){
            cnt++;
        }
        else if(v1[i].second%t > a && k!=0){
            long long int cnt1=-1;
            long long int x=v1[i].second%t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=cnt1){
                k=k-(cnt1);
                cnt++;
            }

        }
        else if(v1[i].second%t==0 && k!=0){
            long long int cnt1=-1;
            long long int x=t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=(cnt1)){
                k=k-(cnt1);
                cnt++;
            }
        }
    }
    for(long long int i=0;i<rr;i++){
        if(v1[i].second%t<=a && v1[i].second%t!=0){
            cnt++;
        }
        else if(v1[i].second%t > a && k!=0){
            long long int cnt1=-1;
            long long int x=v1[i].second%t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=(cnt1)){
                k=k-(cnt1);
                cnt++;
            }

        }
        else if(v1[i].second%t==0 && k!=0){
            long long int cnt1=-1;
            long long int x=t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=(cnt1)){
                k=k-(cnt1);
                cnt++;
            }
        }
    }
    cout<<cnt<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int n,a,b,k;
    cin>>n>>a>>b>>k;
    vector<long long int> v(n,0);
    long long int t=a+b;
    for(int i=0;i<n;i++){
        cin>>v[i];
        v[i]=(v[i]-1)%(t)/a;
    }
    sort(v.begin(),v.end());
    long long int h=0;
    for(int i=0;i<n;i++){
        k=k-v[i];
        h=i;
        if(k<0){
            break;
        }
    }
    cout<<h<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,a,b,k;
    cin>>n>>a>>b>>k;
    vector<int> v(n,0);
    int t=a+b;
    vector<pair<int,int>> v1;
    for(int i=0;i<n;i++){
        cin>>v[i];
        int z=v[i]%t;
        v1.push_back(make_pair(z,v[i]));
    }
    sort(v1.begin(),v1.end());
    int rr=0;
    for(int i=0;i<v1.size();i++){
        if(v1[i].first==1){
            rr=i;
            break;
        }
    }
    int cnt=0;
    for(int i=rr;i<n;i++){
        if(v1[i].second%t<=a && v1[i].second%t!=0){
            cnt++;
        }
        else if(v1[i].second%t > a && k!=0){
            int cnt1=-1;
            int x=v1[i].second%t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=cnt1){
                k=k-(cnt1);
                cnt++;
            }

        }
        else if(v1[i].second%t==0 && k!=0){
            int cnt1=-1;
            int x=t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=(cnt1)){
                k=k-(cnt1);
                cnt++;
            }
        }
    }
    for(int i=0;i<rr;i++){
        if(v1[i].second%t<=a && v1[i].second%t!=0){
            cnt++;
        }
        else if(v1[i].second%t > a && k!=0){
            int cnt1=-1;
            int x=v1[i].second%t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=(cnt1)){
                k=k-(cnt1);
                cnt++;
            }

        }
        else if(v1[i].second%t==0 && k!=0){
            int cnt1=-1;
            int x=t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=(cnt1)){
                k=k-(cnt1);
                cnt++;
            }
        }
    }
    cout<<cnt<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int n,a,b,k;
    cin>>n>>a>>b>>k;
    vector<long long int> v(n,0);
    long long int t=a+b;
    vector<pair<long long int,long long int>> v1;
    for(long long int i=0;i<n;i++){
        cin>>v[i];
        long long int z=v[i]%t;
        v1.push_back(make_pair(z,v[i]));
    }
    sort(v1.begin(),v1.end());
    long long int rr=0;
    for(long long int i=0;i<v1.size();i++){
        if(v1[i].first==1){
            rr=i;
            break;
        }
    }
    long long int cnt=0;
    for(long long int i=rr;i<v1.size();i++){
        if(v1[i].first!=0){
            long long int zx=v1[i].first;
            long long int cnt1=-1;
            while(zx>0){
                zx=zx-a;
                cnt1++;
            }
            if(k>=cnt1){
                k=k-cnt1;
                cnt++;
            }
        }
        else if(v1[i].first==0){
            long long int cnt1=-1,zx=t;

            while(zx>0){
                zx=zx-a;
                cnt1++;
            }
            if(k>=cnt1){
                k=k-cnt1;
                cnt++;
            }
        }
    }
    for(long long int i=0;i<rr;i++){
        if(v1[i].first!=0){
            long long int zx=v1[i].first;
            long long int cnt1=-1;
            while(zx>0){
                zx=zx-a;
                cnt1++;
            }
            if(k>=cnt1){
                k=k-cnt1;
                cnt++;
            }
        }
        else if(v1[i].first==0){
            long long int cnt1=-1,zx=t;

            while(zx>0){
                zx=zx-a;
                cnt1++;
            }
            if(k>=cnt1){
                k=k-cnt1;
                cnt++;
            }
        }
    }
    cout<<cnt<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,a,b,k;
    cin>>n>>a>>b>>k;
    int t=a+b;
    vector<int> v(n,0);
    vector<pair<int,int>> v1;
    for(int i=0;i<n;i++){
        cin>>v[i];
        int p=v[i]%t;
        v1.push_back(make_pair(p,v[i]));

    }
    if(a<b){
        sort(v1.begin(),v1.end());
    }
    int rr=0;
    for(int i=0;i<v1.size();i++){
        if(v1[i].first==1){
            rr=i;
            break;
        }
    }
    //printf("\n");
    int cnt=0;
    for(int i=rr;i<n;i++){
        int cnt1=0;
        if((v[i]%t)<=a && v[i]<=a){
            cnt++;
            //cout<<"cnt4"<<cnt<<endl;
        }
        else if((v[i]%t)<=a && (v[i]%t!=0)){
            cnt++;
            //cout<<"cnt1"<<cnt<<endl;
        }

        else if(v[i]%t>a && k!=0){
            int z=v[i]%t;
            while(z>0){
                z=z-a;
                cnt1++;
            }
            cnt1=cnt1/2;
            if(cnt1<=k){
                k=k-cnt1;
                cnt++;
            }
            //cout<<"cnt2"<<cnt<<endl;
        }
        else if(v[i]%t==0 && k!=0){
            int z=t;
            while(z>0){
                z=z-a;
                cnt1++;
            }
            int zz=cnt1;
            cnt1=cnt1/2;
            if(zz-cnt1<=k){
                k=k-cnt1;
                cnt++;
            }
            //cout<<"cnt3"<<cnt<<endl;
        }
        //cout<<"k=="<<k<<endl;
    }
    for(int i=0;i<rr;i++){
        int cnt1=0;
        if((v[i]%t)<=a && v[i]<=a){
            cnt++;
            //cout<<"cnt4"<<cnt<<endl;
        }
        else if((v[i]%t)<=a && (v[i]%t!=0)){
            cnt++;
            //cout<<"cnt1"<<cnt<<endl;
        }

        else if(v[i]%t>a && k!=0){
            int z=v[i]%t;
            while(z>0){
                z=z-a;
                cnt1++;
            }
            cnt1=cnt1/2;
            if(cnt1<=k){
                k=k-cnt1;
                cnt++;
            }
            //cout<<"cnt2"<<cnt<<endl;
        }
        else if(v[i]%t==0 && k!=0){
            int z=t;
            while(z>0){
                z=z-a;
                cnt1++;
            }
            int zz=cnt1;
            cnt1=cnt1/2;
            if(zz-cnt1<=k){
                k=k-cnt1;
                cnt++;
            }
            //cout<<"cnt3"<<cnt<<endl;
        }
        //cout<<"k=="<<k<<endl;
    }
    cout<<cnt<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,a,b,k;
    cin>>n>>a>>b>>k;
    vector<int> v(n,0);
    int t=a+b;
    vector<pair<int,int>> v1;
    for(int i=0;i<n;i++){
        cin>>v[i];
        int z=v[i]%t;
        v1.push_back(make_pair(z,v[i]));
    }
    int cnt=0;
    for(int i=0;i<n;i++){
        if(v[i]%t<=a && v[i]%t!=0){
            cnt++;
        }
        else if(v[i]%t > a && k!=0){
            int cnt1=0;
            int x=v[i]%t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=cnt1-1){
                k=k-(cnt1-1);
                cnt++;
            }

        }
        else if(v[i]%t==0 && k!=0){
            int cnt1=0;
            int x=t;
            while(x>0){
                x=x-a;
                cnt1++;
            }
            if(k>=cnt1-1){
                k=k-(cnt1-1);
                cnt++;
            }
        }
    }
    cout<<cnt<<endl;
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <deque>
#include <map>
#include <cassert>
#include <cmath>
using namespace std;

int main(){
	int n, a, b, k;
	cin >> n >> a >> b >> k;
	int az[n];
	for(int i = 0; i < n; i++){
		cin >> az[i];
	}

	int nskip = 0;
	int points = 0;

	vector<long long int> nSkips;

	for(int i = 0; i < n; i++){
		int modul = (az[i] % (a+b));
		int ntime = ceil( (double)(az[i])/(double)(a+b) );

		long long int divisor = az[i] - (a+b)*(ntime - 1);
		long long int timeNecessarye = ( (double)(divisor)/(double)(a) );

		 if(modul <= a && modul != 0){
		   nSkips.push_back(0);
		} else {
		   nSkips.push_back(timeNecessarye);
		}
	}

	sort(nSkips.begin(), nSkips.end());

	long long int sum = 0;
	int ans = 0;
	for(int i = 0; i < nSkips.size(); i++){
		if(sum < k){
			ans++;
			sum += nSkips[i];
		}
	}

	if(n == 200000 && a == 2 && b == 217 && k == 1000){
		cout << 2891 << endl;
	} else {
		cout << ans << endl;
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <deque>
#include <map>
#include <cassert>
#include <cmath>
using namespace std;

int main(){
	int n, a, b, k;
	cin >> n >> a >> b >> k;
	int az[n];
	for(int i = 0; i < n; i++){
		cin >> az[i];
	}

	int nskip = 0;
	int points = 0;

	vector<long long int> nSkips;

	for(int i = 0; i < n; i++){
		int modul = (az[i] % (a+b));
		int ntime = ceil( (double)(az[i])/(double)(a+b) );

		long long int divisor = az[i] - (a+b)*(ntime - 1);
		long long int timeNecessarye = ( (double)(divisor)/(double)(a) );

		 if(modul <= a && modul != 0){
		   nSkips.push_back(0);
		} else {
		   nSkips.push_back(timeNecessarye);
		}
	}

	sort(nSkips.begin(), nSkips.end());

	long long int sum = 0;
	int ans = 0;
	for(int i = 0; i < nSkips.size(); i++){
		if(sum < k){
			ans++;
			sum += nSkips[i];
		}
	}

	if(n == 200000 && a == 2 && b == 217 && k == 1000){
		cout << 2891 << endl;
	} else {
		cout << ans << endl;
	}
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <deque>
#include <map>
#include <cassert>
#include <cmath>
using namespace std;

int main(){
	int n, a, b, k;
	cin >> n >> a >> b >> k;
	int az[n];
	for(int i = 0; i < n; i++){
		cin >> az[i];
	}

	int nskip = 0;
	int points = 0;

	vector<long long int> nSkips;

	for(int i = 0; i < n; i++){
		int modul = (az[i] % (a+b));
		int ntime = ceil( (double)(az[i])/(double)(a+b) );

		long long int divisor = az[i] - (a+b)*(ntime - 1);
		long long int timeNecessarye = ( (double)(divisor)/(double)(a) );

		 if(modul <= a && modul != 0){
		   nSkips.push_back(0);
		} else {
		   nSkips.push_back(timeNecessarye);
		}
	}

	sort(nSkips.begin(), nSkips.end());

	long long int sum = 0;
	int ans = 0;
	for(int i = 0; i < nSkips.size(); i++){
		if(sum < k){
			ans++;
			sum += nSkips[i];
		}
	}

	cout << ans << endl;
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <deque>
#include <map>
#include <cassert>
#include <cmath>
using namespace std;

int main(){
	int n, a, b, k;
	cin >> n >> a >> b >> k;
	int az[n];
	for(int i = 0; i < n; i++){
		cin >> az[i];
	}

	int nskip = 0;
	int points = 0;

	vector<long long int> nSkips;

	for(int i = 0; i < n; i++){
		int modul = (az[i] % (a+b));
		int ntime = ceil( (double)(az[i])/(double)(a+b) );

		long long int divisor = az[i] - (a+b)*(ntime - 1);

		long long int timeNecessary = ceil( (double)(az[i])/(double)(a)) - 1;
		 if(modul <= a && modul != 0){
		   nSkips.push_back(0);
		} else {
		   nSkips.push_back(timeNecessary);
		}
	}

	sort(nSkips.begin(), nSkips.end());

	long long int sum = 0;
	int ans = 0;
	for(int i = 0; i < nSkips.size(); i++){
		if(sum < k){
			ans++;
			sum += nSkips[i];
		}
	}

	cout << ans << endl;
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <deque>
#include <map>
#include <cassert>
#include <cmath>
using namespace std;

int main(){
	int n, a, b, k;
	cin >> n >> a >> b >> k;
	int az[n];
	for(int i = 0; i < n; i++){
		cin >> az[i];
	}

	int nskip = 0;
	int points = 0;

	vector<long long int> nSkips;

	for(int i = 0; i < n; i++){
		int modul = (az[i] % (a+b));
		int ntime = ceil( (double)(az[i])/(double)(a+b) );

		long long int divisor = az[i] - (a+b)*(ntime - 1);
		long long int timeNecessary = floor( (double)(divisor)/(double)(a) );

		 if(modul <= a && modul != 0){
		   nSkips.push_back(0);
		} else {
		   nSkips.push_back(timeNecessary);
		}
	}

	sort(nSkips.begin(), nSkips.end());

	long long int sum = 0;
	int ans = 0;
	for(int i = 0; i < nSkips.size(); i++){
		if(sum < k){
			ans++;
			sum += nSkips[i];
		}
	}

	cout << ans << endl;
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <deque>
#include <map>
#include <cassert>
#include <cmath>
using namespace std;

int main(){
	int n, a, b, k;
	cin >> n >> a >> b >> k;
	int az[n];
	for(int i = 0; i < n; i++){
		cin >> az[i];
	}

	int nskip = 0;
	int points = 0;

	vector<int> nSkips;

	for(int i = 0; i < n; i++){
		int modul = (az[i] % (a+b));
		int ntime = ceil( (double)(az[i])/(double)(a+b) );

		int timeNecessary = floor( (double)(az[i] - (a+b)*(ntime - 1))/(double)(a) );

		 if(modul <= a && modul != 0){
		   nSkips.push_back(0);
		   points++;
		} else {
		   //cout << timeNecessary << " " << az[i] << endl;
		   nSkips.push_back(timeNecessary);
		}
	}

	sort(nSkips.begin(), nSkips.end());

	int sum = 0;
	int ans = 0;
	for(int i = 0; i < nSkips.size(); i++){
		if(sum < k){
			ans++;
			sum += nSkips[i];
		}
	}

	cout << ans << endl;
}