#include <iostream>
using namespace std;
int main(int argc, char** argv) {
int p,q,r,P,Q,R;
long long L,D,br = 0;
cin>>p>>q>>r>>L>>D;	
for(long long i=L;i<=D;i++)
{
if(i%p == 0)
P=i/p;
else
P=i/p+1;
if(i%q == 0)
Q=i/q;
else
Q=i/q+1;
if(i%r == 0)
R=i/r;
else
R=i/r+1;
if(P+Q+R<=i)
br++;
}
cout<<br;
return 0;
}