#include <bits/stdc++.h>

using namespace std;

int main()
{
    int p, q, r;
    long long int d, l;
    cin >> p >> q >> r >> d >> l;
    int c = 0;
    for (int i=d; i<= l; i++)
    {
        double prvi = double(i)/p;
        double drugi = double(i)/q;
        double treci = double(i)/r;
        if (ceil(prvi) + ceil(drugi) + ceil(treci) <= i)
        {
            c++;
        }
    }
    cout<<c;
    return 0;
}