#include <iostream>

using namespace std;

int main()
{
    long long p,q,r,L,R,a,b,c,br=0;
    cin>>p>>q>>r>>L>>R;
    for(int i=L; i<=R; i++)
    {
        if(i%p==0)
            a=i/p;
        else
            a=i/p+1;
        if(i%q==0)
            b=i/q;
        else
            b=i/q+1;
        if(i%r==0)
            c=i/r;
        else
            c=i/r+1;
        int zbir=a+b+c;
        if(a+b+c<=i)
        {
            br++;
        }
    }
    cout<<br<<endl;
}