program Project1;
   var p,q,r:longint;
     d,y,x:int64;
     n,i:real;
begin
    d:=0;
  read(p,q,r,x,y);
  if (p*q+q*r+p*r)>(p*q*r) then writeln(0) else       begin
    n:=(q*r+p*r+p*q)/(p*q*r-q*r-p*r-p*q);  end;

    if (n<y) then
    begin
    d:=y-(trunc(n));

    y:=trunc(n);
    end;

                  i:=x;

    while i<=y do begin
         if (p*q*r-q*r-p*r-p*q)= 1 then   begin
         if   ((trunc(i) mod p =0) and (trunc(i) mod q=0)) or ((trunc(i) mod p =0) and (trunc(i) mod r=0)) or((trunc(i) mod r =0) and (trunc(i) mod q=0)) then  begin
      d:=d+1; end;
         i:=i+1;
            end;
             if (p*q*r-q*r-p*r-p*q)> 1 then begin
                if   ((trunc(i) mod p =0) or (trunc(i) mod q=0)) or ((trunc(i) mod r =0)) then  begin
      d:=d+1; end;
         i:=i+1;
             end;
   end;
    writeln(d);

end.