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

int p,q,r;

long long L,R;

int br,zbir=0;

int provera (int x, int y){

    float r=0;

    if (x%y!=0){

        r=x/y+0.5;

        r=round(r);

        return r;
    }

    r=x/y;
    return r;
}


int main () {

    cin>>p>>q>>r>>L>>R;

     if (L<=3){
        cout<<R-2<<endl;
        return 0;
     }



    for (int i=3;i<=L;i++){

        zbir=0;

        zbir=provera(i,p)+provera(i,q)+provera(i,r);


        if (zbir<=i){
            br++;
        }

    }
    cout<<br<<endl;
return 0;
}