{
TASK:rtri
LANG:PASCAL
}
var
l,a,b,c:real;
i1,i2,i3,j1,j2,j3,m,n:integer;
br:longint;

function lice:real;
begin
lice:=0;
lice:=0.5*abs(((i1-i2)*(j1+j2)+(i2-i3)*(j2+j3)+(i3-i1)*(j3+j1)));
end;


begin
br:=0;
readln(m,n);
for i1:=1 to m do
    for j1:=1 to n+1 do
             begin
             for i2:=i1 to m+1 do
                 for j2:=1 to n+1 do
                              if ((i2=i1)and(j2>j1))or(i2>i1) then
                             begin
                               for i3:=i2 to m+1 do
                                   for j3:=1 to n+1 do
                                   if ((i3=i2)and(j3>j2))or(i3>i2) then
                                   begin
                                   a:=0;b:=0;c:=0;
                                   a:=sqrt(sqr(i1-i2)+sqr(j1-j2));
                                   b:=sqrt(sqr(i1-i3)+sqr(j1-j3));
                                   c:=sqrt(sqr(i2-i3)+sqr(j2-j3));
                                   l:=0;
                                   l:=lice;
                                   if ((l=a*b/2)or(l=a*c/2)or(l=c*b/2))and(l>0)and(a>0)and(b>0)and(c>0)
                                   then br:=br+1;
                                   end;
                           end;
             end;
writeln(br);
end.