#include <iostream>
using namespace std;

int main(){
    int p, q, r;
    long long int L, D, br = 0;

    cin >> p >> q >> r >> L >> D;

    for (int i = L; i <= D; ++i){
        if (((int)((i + p - 1) / p)) + ((int)((i + q - 1) / q)) + ((int)((i + r - 1) / r)) <= i)
            br++;
    }

    cout << br;

    return 0;
}