#include <iostream>
#include <cmath>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	double x;
	double y;
	double z;
	double brojac;
	double L;
	double R;
	cin>>x;
	cin>>y;
	cin>>z;
	cin>>L;
	cin>>R;
	for(int i=L; i<=R; i++)
	{
		if(ceil(i/x)+ceil(i/y)+ceil(i/z)<=i)
		{
			brojac++;
		}
	}
	cout<<brojac;
	
}