#include <iostream>

using namespace std;

typedef unsigned long long ull;

ull floor(ull x, ull i) {
	return ((i % x == 0)? i/x : i/x+1);
}

ull sfloor(ull a, ull b, ull c, ull i) {
	return (floor(a, i) + floor(b, i) + floor(c, i));
}

int main() {
	ios_base::sync_with_stdio(false);
    ull a, b, c, r, l, br = 0;
    cin >> a >> b >> c >> r >> l;
    for(int i = r; i <= l; i++) if(sfloor(a,b,c,i) <= i) br++;
    cout << br;
	return 0;	
}