var
a,b,c,m,n,i,j:longint;
procedure tiao(x,y:longint);
begin
if (x=m)and(y=n) then inc(a) else
if (x<=m)and(y<=n)and(x>=1)and(y>=1) then
begin
tiao(x-2,y+1);
tiao(x-1,y+2);
tiao(x+1,y+2);
tiao(x+2,y+1);
end;
end;
begin
assign(input,'horse.in');
assign(output,'horse.out');
reset(input);
rewrite(output);
readln(m,n);
tiao(1,1);
writeln(a);
close(input);
close(output);
end.