program c1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
l,c:array[1..4]of integer;
i,j,k,x1,x2,y1,y2,m:integer;
f:text;

function so(v,rec,za:integer):integer;
var q,w,e,r,ml,ml1,ml2,zat:integer;
begin
//writeln(v);
ml:=100;
for q:=-c[1] to c[1] do
for w:=-c[2] to c[2] do
for e:=-c[3] to c[3] do
for r:=-c[4] to c[4] do
  begin
    if (v=q*l[1]+w*l[2]+e*l[3]+r*l[4]) then
      begin
        ml1:=abs(q)+abs(w)+abs(e)+abs(r);
        if (rec=1) then begin
          c[1]:=c[1]-abs(q);
          c[2]:=c[2]-abs(w);
          c[3]:=c[3]-abs(e);
          c[4]:=c[4]-abs(r);
          ml2:=so(abs(y2-y1),0,ml1);
          c[1]:=c[1]+abs(q);
          c[2]:=c[2]+abs(w);
          c[3]:=c[3]+abs(e);
          c[4]:=c[4]+abs(r);
        end
        else ml2:=0;
        if (rec=1) and (ml2=0) then za:=0;
        if ((za=0) and ((abs(q)+abs(w)+abs(e)+abs(r))<>abs(q+w+e+r))) then
          begin
           if (c[1]-abs(q)>=2) or (c[2]-abs(w)>=2) or(c[3]-abs(e)>=2) or(c[4]-abs(r)>=2) then
            begin
              ml1:=ml1+2;
            end
            else ml2:=-1;
          end;
        if (ml>=(ml1+ml2)) and (ml2>=0) then ml:=ml1+ml2;
        //writeln(rec,' ',v,' ',q,w,e,r,ml2,za,' ',abs(q)+abs(w)+abs(e)+abs(r),'=',abs(q+w+e+r));
      end;
  end;
if ml=100 then so:=-1
else so:=ml;
end;

begin
assign(f,'input.txt');
reset(f);
read(f,x1,y1,x2,y2,k);
for i:=1 to k do
read(f,l[i]);
for i:=1 to k do
read(f,c[i]);

m:=so(abs(x2-x1),1,1);

if ((x2-x1)=0) and ((y2-y1)=0) then m:=0;

close(f);
assign(f,'output.txt');
rewrite(f);
write(f,m);
close(f);

end.
