#include <bits/stdc++.h>
#define ld long double
#define ll long long
using namespace std;

int main(void)
{
    ll p,q,r,L,R,brojac = 0;

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

    for(ld i=L;i<=R;++i)
    {
        if(ceil(i/p)+ceil(i/q)+ceil(i/r)<=i)
            brojac++;
    }
cout<<brojac;

    return 0;
}