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