why I get Compilation Error
var
a:array[0..35,0..35]of integer;
n:integer;
total:longint;
procedure init;
var
i,j:integer;
t:char;
begin
readln(n);
for i:=0 to n+1 do
for j:=0 to n+1 do a[i,j]:=1;
for i:=1 to n do
begin
for j:=1 to n do
begin
read(t);
if t='#' then a[i,j]:=1;
if t='.' then a[i,j]:=0;
end;
readln;
end;
end;
procedure try(i,j:integer);
var
x:integer;
begin
a[i,j]:=2;
if a[i+1,j]=1 then total:=total+9;
if a[i-1,j]=1 then total:=total+9;
if a[i,j+1]=1 then total:=total+9;
if a[i,j-1]=1 then total:=total+9;
for x:=1 to 4 do
begin
if (x=1)and(a[i+1,j]=0) then try(i+1,j);
if (x=2)and(a[i-1,j]=0) then try(i-1,j);
if (x=3)and(a[i,j+1]=0) then try(i,j+1);
if (x=4)and(a[i,j-1]=0) then try(i,j-1);
end;
end;
begin
init;
total:=0;
try(1,1);
write(total-36);
end.