#include <iostream>
using namespace std;
int main(){

long long p;
long long q;
long long r;
long long L;
long long R;
long long counter =0;
cin>> p >> q >> r >> L >> R;
for(long i = L; i<=R;i++){

                long long N = i;
                long long help1;
                long long help2;
                long long help3;
                if (N % p > 0) help1 = N / p + 1;
                else help1 = N / p;
                if (N % q > 0) help2 = N / q + 1;
                else help2 = N / q;
                if (N % r > 0) help3 = N / r + 1;
                else help3 = N / r;
                if (help1 + help2 + help3 <= N) counter++;


}
cout<<counter;
return 0;


}