#include <stdio.h>
#include <stdlib.h>

int main()
{
    int m,p,q,r,br;
    int n,L,R,b;
    scanf("%d %d %d %d %d",&p,&q,&r,&L,&R);
    b=0;
    for(n=L;n<=R;n++)
    {
        br=0;
        if(n%p==0)
            m=n/p;
        else
            m=n/p+1;

            br=br+m;

        if(n%q==0)
            m=n/q;
        else
            m=n/q+1;

            br=br+m;

        if(n%r==0)
            m=n/r;
        else
            m=n/r+1;

            br=br+m;

        if(br<n || br==n)
            b++;
    }



    printf("%d",b);
    return 0;
}