#!/bin/ruby n,x,y = gets.strip.split(' ') n = n.to_i x = x.to_i y = y.to_i sum = 0 for a0 in (0..n-1) latitude,longitude,height,points = gets.strip.split(' ') latitude = latitude.to_i longitude = longitude.to_i height = height.to_i points = points.to_i sum +=points end puts sum