#include<iostream>
#include<algorithm>
using namespace std;


bool odgovara(double N,double p,double q,double r){
double x,y,z;
x=N/p;
y=N/q;
z=N/r;
int a,b,c;
a=x;
b=y;
c=z;
if(a!=x)
    a++;
if(b!=y)
    b++;
if(c!=z)
    c++;
if((a+b+c)<=N)
    return true;
else
    return false;
}



int main(){
double p,q,r;
long long L,R;
long long s=0;
cin>>p;
cin>>q;
cin>>r;
cin>>L;
cin>>R;
for(long long i=L;i<=R;i++){
    if(odgovara(i,p,q,r))
        s++;
}
cout<<s;


return 0;
}