import Control.Applicative ((<$>), (<*>))
import Control.Monad (replicateM)

import Data.List (sort, unfoldr)
import Data.Char (isSpace)

import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B

getIntList :: IO [Integer]
getIntList = unfoldr f <$> B.getContents
    where
        f s = do
            (n, s') <- B.readInteger s
            return (n, B.dropWhile isSpace s')

main :: IO ()
main = solve <$> getIntList >>= print

myCeiling :: Integer -> Integer -> Integer
myCeiling m n = ceiling $ fromInteger m / fromInteger n

solve :: [Integer] -> Integer
solve (n:xs) = (+4) $ myCeiling n $ head $ sort xs