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


int main() {
	double p, q, r, a, b, z = 0;
	cin >> p >> q >> r >> a >> b;
	for (int i = a; i <= b; i++) {
		int x = ceil(i / p) + ceil(i / q) + ceil(i / r);
		if (x <= i)z++;
	}
	cout << z;
	return 0;
}