#include <bits/stdc++.h>
using namespace std;

int main()
{
    double p, q, r;
    long long int L, R;
    cin>>p>>q>>r>>L>>R;
    double x, y, z;
    long long int a, b, c, br=0, x1, y1, z1;
    for(long long int i=L; i<=R; i++)
    {
        x=i/p;
        x1=x;
        if(x-x1!=0)
        {
            a=x1+1;
        }
        else a=x1;
        
        y=i/q;
        y1=y;
        if(y-y1!=0)
        {
            b=y1+1;
        }
        else b=y1;
        
        z=i/r;
        z1=z;
        if(z-z1!=0)
        {
            c=z1+1;
        }
        else c=z1;
        
        if(a+b+c<=i)
        {
            br++;
        }
    }
    cout<<br<<endl;
    return 0;
}