program c1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
 x1,x2,y1,y2:integer;
 NumOtr: array [1..4] of integer;
 Otr: array [1..4] of integer;
 Rez: array [1..100000,1..5,1..2] of integer;
 N,i,j,k,Min:Longint;
 z:array [1..2] of longint;
 Yet:boolean;

Procedure Find(TypeN, Raz:integer);
var
 i1,i2,i3,i4:integer;
 s1,s2,s3,s4:integer;
 n1,n2,n3,n4:integer;
begin
 z[TypeN]:=0;
 For i1:= 0 to NumOtr[1] do
 For i2:= 0 to NumOtr[2] do
 For i3:= 0 to NumOtr[3] do
 For i4:= 0 to NumOtr[4] do
 begin
  if NumOtr[1] = 0 then n1:=1 else n1:=2;
  if NumOtr[2] = 0 then n2:=1 else n2:=2;
  if NumOtr[3] = 0 then n3:=1 else n3:=2;
  if NumOtr[4] = 0 then n4:=1 else n4:=2;
  For s1:= 1 to n1 do
  For s2:= 1 to n2 do
  For s3:= 1 to n3 do
  For s4:= 1 to n4 do
   begin
     If (3-2*s1)*Otr[1]*i1 + (3-2*s2)*Otr[2]*i2 +  (3-2*s3)*Otr[3]*i3 + (3-2*s4)*Otr[4]*i4 = Raz then
     begin
      inc(z[TypeN]);
      Rez[z[TypeN],1,TypeN]:=i1;
      Rez[z[TypeN],2,TypeN]:=i2;
      Rez[z[TypeN],3,TypeN]:=i3;
      Rez[z[TypeN],4,TypeN]:=i4;
      Rez[z[TypeN],5,TypeN]:=i1+i2+i3+i4;
     end;
   end;
  end;
end;

begin
  { TODO -oUser -cConsole Main : Insert code here }

  AssignFile(input,'input.txt');
  reset(input);
  read(x1);
  read(y1);
  read(x2);
  read(y2);
  read(N);

  For i:=1 to N do read(Otr[i]);
  For i:=1 to N do read(NumOtr[i]);
  close(input);

  Find(1,abs(x2-x1));
  Find(2,abs(y2-y1));
  Min := 10000;
  For i:=1 to z[1] do
   For j:=1 to z[2] do
   begin
    Yet:=True;
    For k:=1 to 4 do
     If Rez[i,k,1] + Rez[j,k,2] > NumOtr[k] then  Yet:=false;
     if Yet then
     begin
       If Min> Rez[i,5,1] + Rez[j,5,2] then
        Min :=Rez[i,5,1] + Rez[j,5,2];
     end;
   end;
  if min = 10000 then min:=-1;

  AssignFile(output,'output.txt');
  rewrite(output);
  write(Min);
  close(output);

end.
