main :: IO ()
main = do
    line <- getLine
    putStrLn $ solve line

solve :: String -> String
solve line = show n
    where
        x = read line :: Int
        n = 2 * k + m + 1
        k = (x - 1) `div` 11
        m = maybePlusOne x

maybePlusOne :: Int -> Int
maybePlusOne x
    | (x-1) `mod` 11 < 6    = 0
    | otherwise             = 1
