#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<iostream>
#define eps 1e-7
using namespace std;
const int maxn=265;
const double g=9.8;
double v[maxn];
int n;
double l1,r1,l2,r2,h;
double fun(double a,double b,double c)
{
    double tmp=sqrt(b*b-4*a*c);
    return (-b+tmp)/(2*a);
}
int solve(double x,double h,double v0)
{
    double th,len;
    int hit=0;
    th=acos(x/(v0*sqrt(fun(g*g/4.0,-(g*h+v0*v0),h*h+x*x))));
    for(int i=1;i<=n;i++)
    {
        double vz=v[i];
        len=fun(g/(2.0*vz*vz*cos(th)*cos(th)),tan(th),-h);
        if(len-l2>=eps&&r2-len>=eps)    return 0;
        if(len-l1>=eps&&r1-len>=eps)    hit++;
    }
    return hit;
}
int main()
{
    
    int ans;    
    while(scanf("%d",&n),n)
    {
        scanf("%lf%lf%lf%lf%lf",&h,&l1,&r1,&l2,&r2);
        for(int i=1;i<=n;i++)
            scanf("%lf",&v[i]);
        ans=0;
        for(int i=1;i<=n;i++)
        {
            ans=max(ans,solve(l1,h,v[i]));
            ans=max(ans,solve(r1,h,v[i]));
            ans=max(ans,solve(l2-2*eps,h,v[i]));
            ans=max(ans,solve(r2+2*eps,h,v[i]));
        }
        printf("%d\n",ans);
    }
    return 0;
}