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

int main()
{
    unsigned int p, q, r, a1, a2, i;
    unsigned int b=0;
    float p1,q1,r1;
    unsigned int p2,q2,r2;
    scanf("%u%u%u%u%u",&p,&q,&r,&a1,&a2);
    for(i=a1;i<=a2;i++){
        p1 = (float)i/(float)p;
        p2 = i/p;
        if(p1>(float)p2){
            p2=p2+1;
        }
        q1 = (float)i/(float)q;
        q2 = i/q;
        if(q1>(float)q2){
            q2=q2+1;
        }
        r1 = (float)i/(float)r;
        r2 = i/r;
        if(r1>(float)r2){
            r2=r2+1;
        }
        if(p2+q2+r2<=i){
            b++;
        }
    }
    printf("%u", b);
    return 0;
}