import sys n,m=map(int,sys.stdin.readline().split()) sum=0 for _ in range(n): b=sys.stdin.readline().split() for x in b: sum+=int(x) print(sum)