#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
    int p, q, r;
    long L, R, res=0;
    scanf("%d %d %d %ld %ld", &p, &q, &r, &L, &R);
    double i;
    int t=(R>50)?50:R;
    for(i=(double)(L); i<=t; i++){
        if(ceil(i/p)+ceil(i/q)+ceil(i/r)<=i)res1++;
    }
    if(R>50)res1+=R-50;
    printf("%ld", res);
    printf("\n");
    return 0;
}