program lubenice;
var p,q,r:integer;A,B,br,i:longint;
x1,x2,x3:real;

begin
read(p,q,r,A,B);br:=0;
for i:=A to B do begin
x1:=i/p;x2:=i/q;x3:=i/r;
if frac(x1)>0 then x1:=x1+1-frac(x1);
if frac(x2)>0 then x2:=x2+1-frac(x2);
if frac(x3)>0 then x3:=x3+1-frac(x3);
if x1+x2+x3<=i then br:=br+1;
end;
write(br);
end.