#include <iostream>
using namespace std;
int main(){
	int p,q,r,x1,x2,x3,k=0;
	long long int L,R;
	cin>>p>>q>>r>>L>>R;
	for(int i=L;i<=R;i++){
		if(i%p==0)
			x1=i/p;
		else
			x1=i/p+1;
		if(i%q==0)
			x2=i/q;
		else
			x2=i/q+1;
		if(i%r==0)
			x3=i/r;
		else
			x3=i/r+1;
		if(x1+x2+x3<=i)
			k++;
	}
	cout<<k;
	}