#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	unsigned long long i,br=0,p,q,r,a,b,zbir=0,x,x2,x3;
	cin>>p>>q>>r>>a>>b;
	while(a<=b){
		if(a%p!=0){
			x=a/p+1;
		}
		else{
			x=a/p;
		}
		if(a%q!=0){
			x2=a/q+1;
		}
		else{
			x2=a/q;
		}
		if(a%r!=0){
			x3=a/r+1;
		}
		else{
			x3=a/r;
		}
		//cout<<x<<x2<<x3<<endl;
		if((x+x2+x3)<=a){
			br++;
		}
		a++;
		
	}
	
	
	
	cout<<br;
	return 0;
}