#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <math.h>
#define ll long long

using namespace std;

int main()
{
    /// ima odredjena granica nakon koje su svi deljivi...koja?

    ll L, R, sum = 0, maxx;
    float p, q, r;
    cin >> p >> q >> r >> L >> R;

    maxx = min((ll)1e9, R);

    for (int i = L; i <= maxx; i++)
    {
        if (ceil(i / p) + ceil(i / q) + ceil (i / r) <= i)
            sum++;
    }

    cout << sum;


    return 0;
}