#include <iostream>
#include <math.h>

using namespace std;


int main()
{
    ios_base::sync_with_stdio(0);
    double p,q,r,L,R;
    double score,final_score;
    double value;
    cin >> p >> q >> r >> L >> R;
    final_score = 0;


    for(int i = L; i<=R ; i++)
    {
        score = 0;
        value = ceil(i/p);
        score+=value;
        value = ceil(i/q);
        score+=value;
        value = ceil(i/r);
        score+=value;
        if(score <= i)
        {
            final_score++;
        }
    }

    cout << final_score;
}