#include<iostream>
#include<cmath>
int main() {
	long long p, q, r, L, R, i, a, b, c, br=0;
	std::cin >> p >> q >> r >> L >> R;
	for (i = L; i <= R; i++)
	{
		a = ceil((double)(i) / p);
		b= ceil((double)(i) / q);
		c= ceil((double)(i) / r);
		if (a + b + c <= i)
			br++;

	}
	std::cout << br;
}