program Project1;
   var a,b,c,i,x,y,z :integer;
   var l,d,ddi,r:int64;
   var dd:real;
   function zaokruzi(b:integer;a:integer):integer;
   begin
    if b mod a> 0 then zaokruzi:= (b div a)+1
    else zaokruzi := b div a;
   end;
begin
  read(a);
  read(b);
  read(c);
  read(l); read(d);
  r:=0;
  if (1/a+1/b+1/c)>1 then
  else
   begin
  dd:= 3/(1-1/a-1/b-1/c);
 ddi := round(dd) +1;

  if ddi>d then ddi:=d;
  for i:= l to ddi do
  begin
    x:= zaokruzi(i,a);
    y:= zaokruzi(i,b);
    z:= zaokruzi(i,c);

     if i>= (x+y+z) then else  r:=r+1;
  end;
  r:= (d-l+1)-r;
  end;

  write(r);
  readln;
end.