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

bool lub(int p,int q,int r, int n){
	double a,b,c;
	a=1.0*n/p;
	b=1.0*n/q;
	c=1.0*n/r;
	int ceo=ceil(a);
	//cout<<ceo<<endl;
	if(ceil(a)+ceil(b)+ceil(c)<=n){
		return true;
	}
	else{
		return false;
	}
}

int main(int argc, char** argv) {
	unsigned long long l,d,br=0;
	int p,q,r;
	double pqr;
	cin>>p>>q>>r>>l>>d;
	pqr=1/p+1/q+1/r;
	if(pqr>=1){
		cout<<0;
	}
	else{
		if(l<=100 and d<=100){
			for(int i=l;i<=d;i++){
				br+=lub(p,q,r,i);
				//cout<<lub(p,q,r,i)<<endl;
			}
		}
		else if(l>100 and d>100){
			br=d-l+1;
		}
		else{
			for(int i=l;i<=d;i++){
				br+=lub(p,q,r,i);
				//cout<<lub(p,q,r,i)<<endl;
			}
			br+=d-100;
		}
	}
	cout<<br;
	return 0;
}