#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    double p, q, r, L, RR, z=0;
    double p1, p2, p3, pu;
    cin >> p >> q >> r >> L >> RR;
    for(int i=L;i<=RR;i++)
    {
        p1 = i/p;
        p2 = i/q;
        p3 = i/r;
        /*cout << ceil(p1) << endl;
        cout << ceil(p2) << endl;
        cout << ceil(p3) << endl;
        cout << endl;*/
        pu = ceil(p1)+ceil(p2)+ceil(p3);
        //cout <<pu << endl;
        if(pu<=i)
        {
            //cout << i << endl;
            z++;
        }

    }
    cout << z << endl;
    return 0;
}