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

int main()
{
    long long p, q, r, L, R;
    cin >> p >> q >> r >> L >> R;

    double r1, r2, r3, i, prev = L;
    long long br = 0;

    for (i = L; i <= R; ++i) {

        r1 = ceil(i/p);
        r2 = ceil(i/q);
        r3 = ceil(i/r);

        if ((r1+r2+r3) <= i) {

            ++br;

            //cout << (r1+r2+r3) << "  " << i << endl;
        }
    }

    cout << br;

    return 0;
}