#include <iostream>
using namespace std;
unsigned long long gore(short int n,short int p)
{
	if(n%p)	return n/p+1;
	return n/p;
}
int main()
{
	short int p,q,r;
	unsigned long long x,y,n,brojac=0;
	cin>>p>>q>>r>>x>>y;
	short int ostatak[p*q*r];
	for(short int i=0;i<p*q*r;i++)	ostatak[i]=gore(i,p)+gore(i,q)+gore(i,r);
	for(n=x;n<=y;n++)
	{
		unsigned long long a=n/p/q/r;
		if(a*(p*q+p*r+q*r)+ostatak[n-a*p*q*r]<=n){
			brojac++;
		//	cout<<n<<endl;
		}
	}
	cout<<brojac;
	return 0;
}