#include <bits/stdc++.h>

using namespace std;

int main()
{
    double p, q, r;
    unsigned long long L, R, br=0;
    cin>>p>>q>>r>>L>>R;
    for(unsigned long long i=L; i<=R; i++)
    {
        if((ceil(i/p) + ceil(i/q) + ceil(i/r)) <= i) br++;
    }
    cout<<br;
    return 0;
}