#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, minn;
    float p, q, r;
    cin >> p >> q >> r >> L >> R;

    minn = min((ll)p*(ll)q*(ll)r, R);

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

    sum += (abs(R - minn));

    cout << sum;


    return 0;
}