#include <iostream>
#include <iomanip>
#include <math.h>


using namespace std;
int main()
{
	double L, R, p, q, r, brojac;
	cin >> p >> q >> r >> L >> R;
	brojac = 0;
	for (double i = L; i <= R; i++)
	{
		if (ceil(i / p) + ceil(i / q) + ceil(i / r) > i)
		{
			brojac++;
		}
	}
	cout << R - L + 1 - brojac;
}