main :: IO ()
main = do
  brgcst <- getLine
  if brgcst == "0 0 0 0 0 0"
    then return ()
    else do
      let ls = map read . words $ brgcst
      print $ solve ls
      main

solve :: [Int] -> Int
solve [b,r,g,c,s,t] = b * (15 * 6 - 2 * 5) +
                      r * (15 * 4 - 2 * 3) +
                      g * 7 + c * 2 + s * 3 -
                      (t - b * 5 - r * 3) * 3 + 100