var n,m,a,b,c,d,e,f,z:byte;
x,y:longint;
count:int64;
begin
read(n);
read(m);
count:=0;
if(n>m)
  then
  z:=m
  else
  z:=n;
for a:=0 to n-1 do
  begin
  for b:=0 to n-1 do
    begin
    for c:=0 to m-1 do
      begin
      for d:=0 to m-1 do
        begin
        for e:=0 to n-1 do
           begin
           for f:=0 to n-1 do
             begin
             x:=d+e+f-a-b;
             y:=a+2*b+c-e-2*f;
             if(x>=0)and(y>=0)and(d+e+f+1<=n)and(b+c+d+1<=m)and(a+b+c>0)and(d+b+c>0)and(e+d+c>0)and(d+e+f>0)and(e+f+y>0)and(f+y+x>0)and(x+y+a>0)and(x+a+b>0)
               then
               begin
               count:=count+(m-b-c-d)*(n-d-e-f);
               end;
             end;
           end;
        end;
      end;
    end;
  end;
writeln(count);
end.
