author = "jaykm" n, x, y = map(int, raw_input().split()) ct = 0 for i in xrange(n): la, lo, he, po = map(int, raw_input().split()) ct += po print ct