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