program cccc;

{$APPTYPE CONSOLE}
uses
  SysUtils;
type
  tr=record
    c,l:integer;
  end;
  dd=record
    b:array[1..4]of tr;
    x,y:longint;
  end;
var
  a,b:array[1..441*441]of dd;
  i,j,k,l,c,n,ny:integer;
  x1,x2,y1,y2:integer;
  f:text;
  t:dd;
procedure ftx(k0:byte);
  var
    dir,kk:integer;
  begin
    for kk:=-t.b[k0].c to t.b[k0].c do
      if kk*t.b[k0].l+t.x=x2
        then
        begin
          inc(n);
          for dir:=1 to k do
            a[n].b[dir]:=t.b[dir];
          dec(a[n].b[k0].c,abs(kk));
          a[n].x:=x2;
          a[n].y:=a[1].y;
        end
        else
        begin
          if k0<k then
            begin
              t.x:=t.x+kk*t.b[k0].l;
              dec(t.b[k0].c,abs(kk));
              ftx(k0+1);
              inc(t.b[k0].c,abs(kk));
              t.x:=t.x-kk*t.b[k0].l;
            end;
        end;

  end;
procedure fty(k0:byte);
var
  kk,dir:integer;
begin
  for kk:=-t.b[k0].c to t.b[k0].c do
    if kk*t.b[k0].l+t.y=y2
      then
      begin
        inc(ny);
        for dir:=1 to k do
          b[ny].b[dir]:=t.b[dir];
          dec(b[ny].b[k0].c,abs(kk));
        end
        else
        begin
          if k0<k then
            begin
              t.y:=t.y+kk*t.b[k0].l;
              dec(t.b[k0].c,abs(kk));
              fty(k0+1);
              inc(t.b[k0].c,abs(kk));
              t.y:=t.y-kk*t.b[k0].l;
            end;
        end;


end;

begin
  assignfile(f,'input.txt');
  reset(f);
  read(f,x1,y1,x2,y2,k);
  for i:=1 to k do
    read(f,a[1].b[i].l);
  for i:=1 to k do
    read(f,a[1].b[i].c);  
  closefile(f);
  a[1].x:=x1;
  a[1].y:=y1;
  t:=a[1];
  n:=1;
  if x1<>x2 then ftx(1)else begin n:=2;a[2]:=a[1];end;
  ny:=0;
  if y1<>y2 then
  for i:=2 to n do
    begin
      t:=a[i];
      fty(1);
    end
  else
    begin ny:=n-1;
    for i:=2 to n do
        b[i-1]:=a[i];
      end;
  c:=-1;
  for j:=1 to ny do
    begin
    n:=0;
    for i:=1 to 4 do
      begin
        inc(n,b[j].b[i].c);
      end;
    if n>c then c:=n;
    end;
  if c>-1 then
    begin
    for i:=1 to 4 do
      c:=c-a[1].b[i].c;
      c:=-c;
    end;
  assignfile(f,'output.txt');
  rewrite(f);
  write(f,c);
  closefile(f);
  { TODO -oUser -cConsole Main : Insert code here }
end.
