#include<iostream>
#include<cmath>
using namespace std;

short int p,q,r;
unsigned long long L,R;
unsigned long long rez;
int i;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cerr.tie(nullptr);
		
	cin >> p >> q >> r >> L >> R;
	if ((p + r + q) <= 10){
		cout << 0;
		return 0;
	}
	else if (p == 1 || q == 1 || r == 1){
		cout << 0;
		return 0;
	}
	else if (p == q == 2 || p == r == 2 || q == r == 2){
		cout << 0;
		return 0;
	}
	if (R <= 30){
		for (i = L; i <= R; i++) if ((ceil(i/float(p)) + ceil(i/float(q)) + ceil(i/float(r))) <= i) rez++, cout << i << endl;
		
	}
	else {
		for (i = L; i <= 30; i++) if ((ceil(i/float(p)) + ceil(i/float(q)) + ceil(i/float(r))) <= i) rez++;
		rez += R - 30;
		if (p == 2 || r == 2 || q == 2) rez--;
	}
	
	cout << rez;
	
	return 0;
}