#include <iostream>
#include <math.h> 

using namespace std;
long long int prebroj(float p, float q, float  r, long double  n, long  double l)
{
	long long int br = 0;
	for (float i = n; i <= l; i++) {

		if ((ceil(i / p) + ceil(i / q) + ceil(i / r)) <= i) {
			br++;
		}
	}
	//cout << " prebroj l " << l << " " << br << endl;
	return br;
}

long long int svi(float  p, float  q, float r, long long int  n, long long int l)
{
	long long int br = 0;
	int min = 2;
	if ((p == 2) || (q == 2) || (r == 2)) {
		min = 3;
	}
	if (n > min) {
		br = l - n + 1;
	}
	else br = l - min;
	//cout << " svi " << min << " " << br << endl;

	return br;
}

long long int deljiv1(float p, float q, float  r, long long int n, long long int l)
{
	long long int max = 0;
	long long int br = 0;
	if (p > q) {
		if (p > r) {
			max = p;
		}
		else max = r;
	}
	else if (q > r) {
		max = q;
	}
	else max = r;
	br = (l / max) - ((n-1) / max) ;

	//cout << " deljiv" << max << " " << br << endl;
	return br;
}

long long int mix(float p, float  q, float  r, long long int  n, long long int l) {
	long long int br = 0;
	if (n > 100) {
		br = l - n + 1;
	}
	else if (l < 100) {
		br = prebroj(p, q, r, n, l);
	}
	else {
		br = prebroj(p, q, r, n, 100);
	
		br = l - 100 + br;
	}
	//cout << "mix  l" << l<< " " << br << endl;
	return br;
}


int main()
{
	float p, q, r;
	long double n, l, i;
	long long int br;
	//float ceilP, ceilQ, ceilR;
	cin >> p >> q >> r >> n >> l;

	br = 0;
	if ((p == 1) || (q == 1) || (r == 1)) {
		br = 0;
	}
	else if ((1 / p + 1 / q + 1 / r) > 1) {
		br = 0;
	}
	else if ((p*q + p*r + r*q) == (p*q*r)) {
		br = deljiv1(p, q, r, n, l);
	}
	else if ((1 / p + 1 / q + 1 / r) <= 0.75) {
		br = svi(p, q, r, n, l);
	}
	else br = mix(p, q, r, n, l);
	
	cout << br;

	return 0;

}