#include <iostream>

using namespace std;

int main()
{
    int p, q, r, l, s, n = 0, brl = 0;
    cin >> p >> q >> r >> l >> s;
    for (int i = l; i <= s; i++)
    {
        n += i/p;
        if (i%p != 0)
            n++;
        n+= i/q;
        if (i%q != 0)
        n++;
        n += i/r;
        if (i%r != 0)
            n++;
        if (n<=i)
            brl++;
        n = 0;
    }
    cout << brl << "\n";
    return 0;
}