#include <iostream>
#include <bits/stdc++.h>

using namespace std;

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

    unsigned long long int a, b;
    float p, q, r;
    int res = 0;
    cin>>p>>q>>r>>a>>b;

    for(int i = a; i <= b; i++)
    {
        double x = i / p;
        double y = i / q;
        double z = i / r;

        int c = ceil(x);
        int d = ceil(y);
        int e = ceil(z);

        int rez = c + d + e;
        if(rez <= i)
            res++;
    }

    cout<<res;

    return 0;
}