until (n = gets.to_i) == 0
  sum = 0
  n.times do
    x, y, h, w = file.gets.split.map(&:to_i)
    s = x + y + h
    if s <= 60 and w <= 2
      sum += 600
    elsif s <= 80 and w <= 5
      sum += 800
    elsif s <= 100 and w <= 10
      sum += 1000
    elsif s <= 120 and w <= 15
      sum += 1200
    elsif s <= 140 and w <= 20
      sum += 1400
    elsif s <= 160 and w <= 25
      sum += 1600
    end
  end
  puts sum
end