#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
	
	unsigned short int p,q,r;
	unsigned long int L,R,i,cnt=0;
	scanf("%hu %hu %hu %lu %lu",&p,&q,&r,&L,&R);
	
	
	
	for(i=L;i<=R;i++){
		if(i%p==0 && i%q==0 && i%r==0 && (i/p+i/q+i/r)<i)
			cnt++;
		else{
		float x=(float)i/p,y=(float)i/q,z=(float)i/r;
		
		if((int)x<(float)x){
			x=(int)x+1;
			}
		if((int)y<(float)y){
			y=(int)y+1;
		}
		if((int)z<(float)z){
			z=(int)z+1;
		}
		
		if(x+y+z<=i){
			cnt++;
			}
		}
		
	}
	
	printf("%lu",cnt);
	
	return 0;
}