#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    long long unsigned L, M, brojac = 0;
    long double p, q, r;
    cin >> p >> q >> r >> L >> M;

    long double a, b, c;
    for(long long unsigned i = L; i <= M; i++){
        a = ceil(i / p);
        b = ceil(i / q);
        c = ceil(i / r);
        if(a + b + c <= i){
            brojac++;
        }
    }

    cout << brojac;
    return 0;
}