#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

float r,p,q;
long long R,L;
long long sol;

int main (){
    cin >> p >> q >> r >> L >> R;
    for (long long i = L; i <= R; i++){
        if ((ceil(i*1.0/p) + ceil(i*1.0/r) + ceil(i*1.0/q)) <= i){
            sol++;
        }
    }
    cout << sol << endl;
    return 0;
}