#include <iostream>
#include <algorithm>
using namespace std;
long long int f(long long int n,long long int l,long long int d)
{
     if(n>d || n<2) return 0;
     if(n<l) return d-l+1;
     return d-n+1;
}
int main()
{
    long long int p,q,r,l,d;
    cin>>p>>q>>r>>l>>d;
    long long int n=(4*p*q*r-2*p*q-2*p*r-2*q*r-1)/(p*q*r-p*q-p*r-q*r);
    long long int rez=f(n,l,d);
    long long int m;
    if(n<d) m=n-1;
    else m=d;
    for(int i=l;i<= m;i++)
    {
        if((i+p-1)/p+(i+q-1)/q+(i+r-1)/r<=i) rez++;
    }
    cout<<rez;
    
    
    
    return 0;
    
    
}