#include <iostream>
#include <math.h>
using namespace std;

float p, q, r, L, R;
float resa, resb, resc;
int res = 0;

int main()
{
	cin >> p >> q >> r >> L >> R;

	for (int i = L; i <= R; i++) {
	
		resa = ceil(i / p);
		resb = ceil(i / q);
		resc = ceil(i / r);

		if (resa + resb + resc <= i) {
			res++;
		}
	}

	cout << res;
}