n, m = map(int, input().split()) count = 0 for row in range(n): a = list(map(int, input().split())) count += sum(a) print(count)