n, m = map(int, input().split())

count = 0

for i in range(n):
    a = list(map(int, input().split()))
    count += sum(a)

print(count)