#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main() {
	
	ios::sync_with_stdio(0);
	cin.tie(0);
		
		
	int p,q,r;
	unsigned long long int L,R;
	int i=0;
	
	cin >> p;
	cin >> q;
	cin >> r;
	cin >> L;
	cin >> R;
	
	for (; L<=R; L++) {
		
		
		if(( ceil((long double)L/p)+ ceil((long double)L/q ) + ceil((long double)L/r) ) <= L) {
			i++;
			
		}
		
	}
	cout << i;
	
}