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