#include <bits/stdc++.h>
#define endl "\n"
using namespace std;

uint64_t get_num(uint64_t n, uint64_t r){
    if (n % r != 0)
     return n / r + 1;
    return n / r;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int p, q, r;
    uint64_t levo, desno;
    cin >> p >> q >> r >> levo >> desno;

    uint64_t res = 0, np, nq, nr;
    while (levo++ <= desno){
        np = get_num(levo, p);
        nq = get_num(levo, q);
        nr = get_num(levo, r);
        if (np + nq + nr <= levo)
            res++;
    }

    cout << res << endl;

    return 0;
}