#include <iostream>
#include<algorithm>

using namespace std;

long long int nadji(long long int l, long long int d,long long int k)
{
    if(l%k==0 || d%k==0) return 1+(d-l+1)/k;
    else return (d-l+1)/k;
}

int main()
{
    ios::sync_with_stdio(false);

    long long int i,p,q,r,l,d,a,b,k,res,t;

    cin>>p>>q>>r>>l>>d;


    a=p*q+p*r+r*q;
    b=p*q*r;

    k=1;  // k ce biti nys od p, q i r
    while(k)
    {
        if(k%p==0 && k%q==0 && k%r==0) break;
        k++;
    }

    if(a>b) cout<<0;
    else if(a==b) cout<<nadji(l,d,k);
    else
    {
        res=0;
        for(i=l;i<=min(d,3*b);i++)
        {
            t=(i+p-1)/p+(i+q-1)/q+(i+r-1)/r;
            if(t<=i) res++;
        }
        if(i<=d) res+=d-i+1;

        cout<<res;
    }

    return 0;
}