#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 100005;
ll ceil(ll x, ll y){
	if(x % y == 0)return x/y;
	return (x/y + 1);
}
int main()
{
	ll p, q, r, a, b;
	cin >> p >> q >> r >> a >> b;
	ll brojac = 0;
	for(int i=a;i<=b;i++){
		if(ceil(i,p) + ceil(i,q) + ceil(i,r) <= i)brojac++;
	}
	cout << brojac << endl;
	return 0;
}