#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <algorithm>    

int main(int argc, char** argv)
{
	int r,p,q,a,b,c,br,nzspq,nzspqr,j,i;
	long int l,n;
	br=0;
	std::cin>>p>>q>>r>>l>>n;
	if (n<100000){
	for (int i=l;i<=n;i++)
	{
		a=ceil((float)i/p);
		b=ceil((float)i/q);
		c=ceil((float)i/r);
		if (i%p==0)
		{a=i/p;}
		if (i%q ==0)
		{b=i/q;}
		if (i%r ==0)
		{c=i/r;}		
		if((a+b+c)<=i)
		br++;
		
	}
	}
	else
	{
	i=l;
	nzspq=(p*q)/std::__gcd(p,q);
	nzspqr=(nzspq*r)/std::__gcd(nzspq, r); 
	while (i<nzspqr)
	{
		if((i%p)*(nzspqr/p)+(i%q)*(nzspqr/q)+(i%r)*(nzspqr/q)<=1)
		{
			br++;
		} 
	i++;
	}
	j=((n+1-l)/br)+1;
	while (j<=n)
	{
		if((j%p)*(nzspqr/p)+(j%q)*(nzspqr/q)+(j%r)*(nzspqr/q)<=1)
		{
			br++;
		} 
	j++;
	}
	}
	std::cout<<br;
	return 0;
}