#include <stdio.h>
#include <stdlib.h>
int razlomci(unsigned long long int n,int p)
{
    if(n%p==0)
        return n/p;
    return n/p + 1;
}
int main()
{
    int p,q,r,s;
    unsigned long long int L,R,i,br=0;
    scanf("%d",&p);
    scanf("%d",&q);
    scanf("%d",&r);
    if(q>p)
    {
        s=p;
        p=q;
        q=s;
    }
    if(r>p)
    {
        s=p;
        p=r;
        r=s;
    }
    if(r>q)
    {
        s=q;
        q=r;
        r=s;
    }
    scanf("%llu",&L);
    scanf("%llu",&R);
    if(R<=2 || r==1  || q<=2 || (p<=5 && q==3 && r==2))
        printf("%d",0);
    else
    {
        if(p==6 && q==3 && r==2)
        {
            if(R<6)
                printf("%d",0);
            else
            {
                if(L%6==0)
                    printf("%llu",R/6-L/6+1);
                else
                    printf("%llu",R/6-L/6);
            }
        }
        else
        {
            if(p==4 && q==4 && r==2)
            {
                if(R<4)
                    printf("%d",0);
                else
                {
                    if(L%4==0)
                        printf("%llu",R/4-L/4+1);
                    else
                        printf("%llu",R/4-L/4);
                }
            }
            else
            {
                if(p==3 && q==3 && r==3)
                {
                    if(R<3)
                    printf("%d",0);
                    else
                    {
                        if(L%3==0)
                            printf("%llu",R/3-L/3+1);
                        else
                            printf("%llu",R/3-L/3);
                    }
                }
                else
                {
                    if(L>43)
                        printf("%llu",R-L+1);
                    else
                    {
                        for(i=L;i<=R && i<44;i++)
                        {
                            if(razlomci(i,p)+razlomci(i,q)+razlomci(i,r)<=i)
                                br++;
                        }
                        if(R<44)
                            printf("%llu",br);
                        else
                            printf("%llu",br+R-43);
                    }
                }
            }
        }
    }
}