#include <iostream>

using namespace std;

#include <iostream>

using namespace std;

int ceil(float num) {
    int inum = (int)num;
    if (num == (float)inum) {
        return inum;
    }
    return inum + 1;
}

int main()
{
    float p, q, r, mini, maks, brojac;
    cin >> p >> q >> r >> mini >> maks;
    for(int i = mini; i <= maks; i++){
        if((ceil(float(i / p)) + ceil(float(i / q)) + ceil(float(i / r))) <= i){
                brojac++;
            }
    }
    cout << brojac;
    
    return 0;
}