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

long long int rup(long long int a, long double v)
{
    long double f = a/v;
    //printf("F: %Lf\n", f);
    long long int i = a/v;
    if(f > i)
    {
        //printf("I: %lli\n", i+1);
        return i+1;
    }
    else
    {
        //printf("I: %lli\n", i);
        return i;
    }
}

int main()
{
    long long int p,q,r,L,R;
    long long int end = 0;
    scanf("%lli %lli %lli %lli %lli", &p, &q, &r, &L, &R);
    for(long long int i = L; i<=R; i++)
    {
        long long int sum = rup(i,p) + rup(i,q) + rup(i,r);
        //printf("SUM: %lli\n", sum);
        if(sum <= i)
        {
            end++;
        }
    }
    printf("%lli", end);

    return 0;
}