#include <iostream>

using namespace std;
int p,q,r;
long L,R,b;
long z(long n,int x)
{
    if(n%x==0) return n/x;
    else{
        return n/x+1;
    }
}
int main()
{
    cin>>p>>q>>r>>L>>R;
    for(int i=L;i<=R;i++)
    {
        if(z(i,p)+z(i,q)+z(i,r)<=i) b++;
    }
    cout<<b;
}