#include<stdio.h>
long long p,q,r,L,R,x,y,z,s=0;
int main(){
	scanf("%lld %lld %lld %lld %lld",&p,&q,&r,&L,&R);
	for(long long i=L;i<=R;i++){
		x=i/p;
		if(i%p!=0)x++;
		y=i/q;
		if(i%q!=0)y++;
		z=i/r;
		if(i%r!=0)z++;
		if(x+y+z<=i)s++;
	}
	printf("%lld",s);
	return 0;
}