#include <iostream>
using namespace std;
#include <bits/stdc++.h>
typedef long long ll;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int MAXN = 2e5+100;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
//Znam da ne radi.
int main(int argc, char** argv) {
	
	ll p, q, r, L, R;
	cin >> p >> q >> r >> L >> R;
	ll ans = 0;
	for(ll i = L; i <= R; i++){
		if(ceil((double)i/p) + ceil((double)i/q) + ceil((double)i/r) <= i){
			ans++;
		}
	}
	cout << ans;
	return 0;
}