#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;
        pu = ceil(p1)+ceil(p2)+ceil(p3);
        if(pu<=i)
        {
            z++;
        }

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