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