#include <bits/stdc++.h>

using namespace std;
int nzd(int a, int b){
    if(b==0) return a;
    else return nzd(b,a%b);
}
int maks(int p, int q, int r){
    return max(max(p,q),max(q,r));
}
int mini(int p, int q, int r){
    return min(min(p,q),min(q,r));
}
int sred(int p,int q, int r){
    if(p!=mini(p,q,r) && p!=maks(p,q,r)){
        return p;
    }
    if(q!=mini(p,q,r) && q!=maks(p,q,r)){
        return q;
    }
    if(r!=mini(p,q,r) && r!=maks(p,q,r)){
        return r;
    }
}
long long int naVeci(long long int n, int p){
    if(n%p==0){
        return n/p;
    }
    else{
        return floor(n/p)+1;
    }
}

int main()
{
    int p,q,r;
    long long int l,d;
    int ans=0;
    cin >> p >> q >> r >> l >> d;
    double k = 1.0/p + 1.0/q + 1.0/r;
    if(k>1){
        cout << "0" << endl;
        return 0;
    }
    if(k==1){
        int x = (p*q)/nzd(p,q);
        int nzs = x*r/nzd(x,r);
        for(int i=(l/nzs)+1;nzs*i<=d;i++){
            long long int w = nzs*i;
            if(w<=d){
                ans++;
            }
        }
        cout << ans << endl;
        return 0;
    }
    if(mini(p,q,r)>=3 && maks(p,q,r)>=5 && sred(p,q,r)>=4){
        for(long long int i=l;i<=d;i++){
            if(i!=1 && i!=2){
                ans++;
            }
        }
        cout << ans << endl;
        return 0;
    }
    else{
        int x = (p*q)/nzd(p,q);
        int nzs = (x*r)/nzd(x,r);
        if(nzs+2>=l && nzs+2<=d){
            ans+=d-(nzs+2)+1;
        }
        for(long long int i=l;i<=d && i<=nzs+1;i++){
            if(naVeci(i,p)+naVeci(i,q)+naVeci(i,r)<=i){
                ans++;
            }
        }
        cout << ans << endl;
    }

    return 0;
}