program zadatak;
var
p,q,r,d,n,st:longint;
x,y,z:real;
begin
read(p,q,r,l,d);
x:=n/r;
y:=n/q;
z:=n/p;
for n:=l to d do begin
IF ( round(x + 0.49)+(y + 0.49)+round(z + 0.49)<=n) then begin
   st:=st+1;
end;
end;
WRITE(st);

end.