n,m = map(int,input().split()) list1=[] list2=[] for i in range(n): a=list(map(int,input().split())) list1.extend(a) for j in list1: if j>0: list2.append(j) print(sum(list2))