#include <iostream>
#include <cmath>

using namespace std;

int main(){

double p,q,r;
long long L,R,rez = 0;
double tp,tq,tr;
cin >> p >> q >> r >> L >> R;

for(long long i = L;i <= R;i++)
{
	tp = ceil(i/p);
	tq = ceil(i/q);
	tr = ceil(i/r);
	
	if(tp + tq + tr <= i) rez++;
}

cout << rez << endl;


	return 0;
}