int input int for in input split for in range for in range for in rang

1
2
3
4
5
6
7
8
9
a = int(input())
n = 0
A = [[int(j) for j in input().split()] for i in range(a)]
for i in range(a):
for j in range(a):
if (A[i][j]==1):
n+=1
A[j][i]=0
print(n)