#include<iostream>
#include<cmath>
using namespace std;
int main(){
    int p,q,r,b=0,n;
    unsigned int L,R;
    cin>>p>>q>>r>>L>>R;
    for(n=L;n<=R;n++){
        if( (ceil(n*1.0/p)+ceil(n*1.0/q)+ceil(n*1.0/r)) <= n )
            b++;
    }
    cout<<b;
    return 0;
}