#include <iostream>
#include <cmath>
using namespace std;
int p, q, r, ls, rs, br = 0;;
int main() {
	cin >> p >> q >> r >> rs >> ls;
	for (int i = rs; i <= ls; i++) {
		if ((ceil((double)i / p) + ceil((double)i / q) + ceil((double)i / r)) <= i) {
			br++;
		}
	}
	cout << br;
	return 0;
}