program luben;
var
a,b,d,p,q,r,s,i,j,t:longint;
c,e,f:double;
begin
read(p);
read(q);
read(r);
read(a);
read(b);
j:=0;
for i:=a to b do begin
c:=i/p;
if c > round(c) then d:= round(c)+1
else d:= round(c);
e:=i/q;
if e > round(e) then t:= round(e)+1
else t:= round(e);
f:=i/r;
if f > round(f) then s:= round(f)+1
else s:= round(f);
if d+t+s<=i then j:=j+1;
end;
write(j);
end.