#include <bits/stdc++.h>
using namespace std;
int main() 
{
unsigned long long p,q,r,a,b,br=0;
cin>>p>>q>>r>>a>>b;
unsigned long long granica=((p*q*r)+min(min(p,q),r));
for(double i=a;i<=min(granica,b);i++)
{
if(ceil(i/p)+ceil(i/q)+ceil(i/r)<=i)
br++;
}
if(b<=granica)
cout<<br<<endl;
else
{
cout<<b-(granica-br)<<endl;
}
return 0;
}