{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import Data.Int

main :: IO ()
main = putStrLn =<< show . solve <$> readLn

solve :: Int64 -> Int64
solve x
    | q == 0 = p * 2
    | q <= 6 = p * 2 + 1
    | otherwise = p * 2 + 1
    where (p, q) = x `divMod` 11
