a,b = map(int,input().split())
b=0
for i in range(a):
    b+=sum(list(map(int,input().split())))
print(b)