#include<iostream>

#include<cmath>
using namespace std;
int main(){

double L,R,n,p,q,r,x,y,z;
int t;
cin>>p;
cin>>q;
cin>>r;
cin>>L;
cin>>R;
t=0;
n=L;
ios::sync_with_stdio(false);
while (n<=R){

	x=n/p;
	y=n/q;
	z=n/r;
	if(ceil(x)+ceil(y)+ceil(z)<=n){
	t=t+1;
}
n++;	
}

cout<<t;


}