Var n, i, j, ans : integer;
a : array[,] of integer;
begin
read(n);
ans := 0;
SetLength(a, n + 1, n + 1);
for i := 1 to n do
for j := 1 to n do
read(a[i, j]);
for i := 1 to n do
for j := i + 1 to n do
if (a[i, j] > 0) then
ans := ans + 1;
writeln(ans);
end.