#include <vector>
#include <iostream>
#include <list>
#include <algorithm>
using namespace std;
double p, q, r;
bool uslov(int N) {
	int x =ceil( N / p);
	int y =ceil( N / q);
	int z =ceil( N / r);
	if ((x + y + z )<= N)
		return true;
	else
		return false;
}

int main()
{
	
	long long L, R;
	cin >> p >> q >> r >> L >> R;
	vector<int>vec;
	for (int i = L; i <= R; i++) {

		vec.push_back(i);

	}
	
	int noEven = count_if(vec.begin(), vec.end(),uslov);
	cout << noEven;
}