n,W = map(int,input().split()) ans = 0 for _ in range(n): v,x = map(int,input().split()) ans += v print(ans)