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

Sum = 0
for _ in range(n):
    a = list(map(int, input().split()))
    Sum += sum(a)

print(Sum)