plusNum d n
   | n == 0    = 0
   | otherwise = n + d*15

main = do
   n <- read <$> getLine
   let (d,m) = n `divMod` 15
   putStrLn $ show $ 60*d*d + (sum $ take m $ map (plusNum d) [1,2,0,4,0,0,7,8,0,0,11,0,13,14,0])
