#include <iostream>

using namespace std;

typedef unsigned long long ull;

#define plafon(x, y) (x + y - 1)/y

static ull p, q, r, L, R;

int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    	cin >> p >> q >> r >> L >> R;
        	ull resenje = 0;
            	for (int n = L; n <= R; n++)
                		resenje += plafon(n, p) + plafon(n, q) + plafon(n, r) <= n;
                        	cout << resenje;
                            }