n,m=list(map(int,input().split()))
sums=0
for i in range(n):
    a=list(map(int,input().split()))
    sums=sums+sum(a)
print(sums)