#include <iostream>
#include <math.h>
typedef long long ll;
using namespace std;
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie();
	cout.tie();
	int p, q, r;
	ll L, R;
	cin >> p >> q >> r >> L >> R;
	ll br = 0;
	for (auto i = L; i <= R; ++i)
	{
		if (ceil(static_cast<double>(i) / p) + ceil(static_cast<double>(i) / q) + ceil(static_cast<double>(i) / r) <= i)
		{
			br++;
		}
	}
	cout << br << endl;
	return 0;
}