program matrix;
var
n,i,j,k,l,m,ceng,qishi,bianj1,bianj3:longint;
begin
assign(input,'matrixc.in');
reset(input);
assign(output,'matrixc.out');
rewrite(output);
readln(n,i,j);
k:=i;
ceng:=i;
if j<ceng then ceng:=j;
if (n-i+1)<ceng then ceng:=n-i+1;
if (n-j+1)<ceng then ceng:=n-j+1;
for k:=1 to ceng-1 do inc(qishi,(n-k*2+1)*4);
qishi:=qishi+1;
if (n mod 2=1)and(ceng=n div 2+1) then begin
writeln(n*n);
close(input);
close(output);
halt;
end;
bianj1:=ceng;
bianj3:=n-ceng+1;
if (i=bianj1)and(j<bianj3) then writeln(qishi+(j-bianj1));
if (j=bianj3)and(i<bianj3) then writeln(qishi+(bianj3-bianj1)+(i-bianj1));
if (i=bianj3)and(j>bianj1) then writeln(qishi+(bianj3-bianj1)*2+(bianj3-j));
if (j=bianj1)and(i>bianj1) then writeln(qishi+(bianj3-bianj1)*3+(bianj3-i));
close(input);
close(output);
end.