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

int main(){
	double p, q, r, L, R;
	int brojac = 0, rez;
	cin >> p >> q >> r >> L >> R;
	for(int i = L; i <= R; i++){
		rez = ceil(i / p) + ceil(i / q) + ceil(i / r);
		if(rez <= i)brojac++;
	}
	cout << brojac;
	return 0;
}