#include <stdio.h>

void main() {
	int p, q, r;
	long long min, max, rez=0, pp, qq, rr;
	scanf("%d%d%d%lld%lld", &p, &q, &r, &min, &max);
	for (long long i = min; i <= max; i++) {
		if (i % p == 0) pp = i / p;
		else pp = (i / p) + 1;
		if (i % q == 0) qq = i / q;
		else qq = (i / q) + 1;
		if (i % r == 0) rr = i / r;
		else rr = (i / r) + 1;

		if ((pp + qq + rr) <= i) {
			rez++;
		}
		if (rez == 150) {
			rez += max - i;
			break;
		}
	}
	printf("%lld ", rez);
}