#include <stdio.h>
#define ceil(X,Y) ((X+Y-1)/Y)

int main()
{
    unsigned int 
    n,cnt = 0,total = 0,
    p,q,r,L,R,
    limit = 0;
    
    scanf("%u %u %u %u %u",&p, &q, &r, &L, &R);
    
    //scanf("%lf %lf %lf %u %u",&p, &q, &r, &L, &R);
    
    //L da bude manje od R
    if(L>R){
        n = L;
        L = R;
        R = n;
    }
    /*
    //poredjati p q r po velicini
    if(q>p){
        if(r>q){
            
        }
    }
    */
    
    /*
    //ako [x]+[x]+[x] > R nema resenja
    if((qceil(n,p) + qceil(n,q) + qceil(n,r)) > R)
    {
        printf("0");
        return 0;
    }
    */
    n = (L+R);
    limit = ceil(n,2); //sredina izmedju L i R
    
    n = L-1; //i ide od manjeg ka vecem
    while(n++!=R){
        
        total = ceil(n,p) + ceil(n,q) + ceil(n,r);
        
        //printf("[%u/%u](%u) + [%u/%u](%u) + [%u/%u](%u) = %u (%u)\n",n,p,ceil(n,p),n,q,ceil(n,q),n,r,ceil(n,r),total,n);
    
        if(total<=n)cnt++;
    }

    printf("%d",cnt);
    
    //printf("\n%lf %lf %lf %d %d",p, q, r, L, R);
    
    return 0;
}