#include<stdio.h>
#include<math.h>
float P;
long long L,D,p,q,r,a,b,c;
int br=0,i;
int main(){
	scanf("%lld%lld%lld%lld%lld",&p,&q,&r,&L,&D);
	P=(1.0/p)+(1.0/q)+(1.0/r);
    if(P>1)printf("%lld",br);
    else {
		for(i=L;i<=D;i++){
		if(i%p!=0)a=i/p+1;
        else a=i/p;
        if(i%q!=0)b=i/q+1;
        else b=i/q;
        if(i%r!=0)c=i/r+1;
        else c=i/r;
        if(a+b+c<=i)br++;
	}
	printf("%d",br);
}
	return 0;
}