#include <iostream>

using namespace std;

double pr(double n){
    if(n-(int)n)
        n=(int)n+1;
    return n;
}

int main()
{
    int p,q,r;
    cin>>p>>q>>r;
    int L,R;
    cin>>L>>R;
    int br=0;
    for(int i=L;i<=R;i++){
        double a=i/(double)p;
        double b=i/(double)q;
        double c=i/(double)r;
        a=pr(a);
        b=pr(b);
        c=pr(c);
        if(a+b+c<=i)
            br++;
    }
    cout<<br;
    return 0;
}