var a,h,i,j,k:integer; begin Assign(input,'input.txt'); reset(input); Assign(output,'output.txt'); rewrite(output); readln(a,h); k:=0; // (x-x1)/(x2-x1)=(y-y1)/(y2-y1) for i:=1 to a-1 do for j:=1 to h-1 do if ((i-0)/(trunc(a/2)-0)>(j-0)/(h-0)) and ((i-a)/(trunc(a/2)-a)>(j-0)/(h-0)) then k:=k+1; writeln(k); end.