#include <iostream>
using namespace std;
int main()
{
	short int p,q,r;
	unsigned long long x,y,n,brojac=0;
	cin>>p>>q>>r>>x>>y;
	if(p*q*r-p*q-p*r-q*r<0)
		cout<<y-x+1;
	else{
		for(n=x;n<=y&&n<2*p*q*r;n++)
		{
			short int o=0;
			if(n%p)	o++;
			if(n%q)	o++;
			if(n%r)	o++;
			if(n/p+n/q+n/r+o<=n)
				brojac++;
		}
		brojac+=y-n+1;
		cout<<brojac;
	}
	return 0;
}