import Control.Monad

main :: IO ()
main = do
  n <- readLn
  if n == 0
    then return()
    else do
      ls <- replicateM n getLine
      let ls' = map (map (read :: String -> Int)) (map words ls)
          ans = sum (map check (map fix ls'))
      putStrLn $ show ans
      main

fix :: [Int] -> (Int,Int)
fix [x,y,h,w] = (x+y+h,w)

checkl :: (Int,Int) -> Int
checkl (l,_)
  |l <= 60 = 600
  |l <= 80 = 800
  |l <= 100 = 1000
  |l <= 120 = 1200
  |l <= 140 = 1400
  |l <= 160 = 1600
  |otherwise = 0

checkr :: (Int,Int) -> Int
checkr (_,r)
  |r <= 2 = 600
  |r <= 5 = 800
  |r <= 10 = 1000
  |r <= 15 = 1200
  |r <= 20 = 1400
  |r <= 25 = 1600
  |otherwise = 0

check :: (Int,Int) -> Int
check t
  |checkl t == 0 = 0
  |checkr t == 0 = 0
  |otherwise = max (checkl t) (checkr t)