#include <bits/stdc++.h>
using namespace std;

int p,q,r;
long long int l,d;
int countof (int n) {
    int res=0;
    if (p==n) res+=1;
    if (q==n) res+=1;
    if (r==n) res+=1;
    return res;
}
int deljsa(int n) {
    int poc=l+n-l%n;
    int kr=d-d%n;
    return (kr-poc)/n;
}
int rez (int n) {
    int res=n/p+n/q+n/r;
    if (n%p!=0) res+=1;
    if (n%q!=0) res+=1;
    if (n%r!=0) res+=1;
    return res;
}
void ostalo() {
    double a=1/(double)p+1/(double)q+1/(double)r;
    long long int i=l;
    long long int res=0;
    while (i*a+3>i&&i<=d) {
        if (rez(i)<=i) res+=1;
        i+=1;
    }
    if (i<=d) {
        res+=(d-i+1);
    }
    cout<<res;
}
int main() {
    scanf("%d %d %d %lld %lld",&p,&q,&r,&l,&d);
    if (countof(2)>=2) {
        cout<<0;
    }
    else if (countof(2)==1) {
        if (countof(3)==2) {
            cout<<0;
        }
        else if (countof(3)==1) {
            if (countof(4)==1) {
                cout<<0;
            }
            else if (countof(5)==1) {
                cout<<0;
            }
            else if (countof(6)==1) {
                cout<<deljsa(6);
            }
            else {
                ostalo();
            }
        }
        else {
            if (countof(4)==2) {
                cout<<deljsa(4);
            }
            else {
                ostalo();
            }
        }
    }
    else {
        if (countof(3)==3) {
            cout<<deljsa(3);
        }
        else {
            ostalo();
        }
    }
}