#include <bits/stdc++.h>
using namespace std;
long double l,R,br,p,q,r,res;
int main () {
    br=0;
    freopen("upis.txt","r",stdin);
    freopen("ispis.txt","w",stdout);
    cin>>p>>q>>r>>l>>R;
    for(double i=l;i<=R;i++){
        res=ceil(i/p)+ceil(i/q)+ceil(i/r);
        if(res<=i){br++;}
    }
    cout<<br<<endl;
    return 0;
}