#include <iostream>
#include <cmath>
using namespace std;
int main() {
    int p, q, r, L, R, a = 0;
    cin >> p >> q >> r >> L >> R;
    for(int i = L ; i <= R ; i++)
    if(ceil((double) i / p) + ceil((double) i / q) + ceil((double) i / r) <= i) a++;
    cout << a;
    return 0;
}