#include <iostream>
#include <cmath>
using namespace std;
int main() {
	int p, q, r;
	unsigned long long int L, R, brojevi = 0;
	cin >> p >> q >> r >> L >> R;
	for (unsigned long long int i = L; i <= R; i++) {
		if (ceil(i / (double)p) + ceil(i / (double)q) + ceil(i / (double)r) <= (double)i) {
			brojevi += 1;
		}
	}
	cout << brojevi << endl;
	//system("pause");
	return 0;
}