#include<stdio.h>
long p,q,r,L,R,x,y,z,s=0;
int main(){
	scanf("%ld%ld%ld%ld%ld",&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("%ld",s);
	return 0;
}