{-# LANGUAGE BangPatterns #-}

import Control.Monad
import Data.List
import Data.Ord (comparing)
import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed as UV

-- [a,b) -> a .. f aがTrueとなる最大のa, f bはFalse
-- aとbは評価しないので、範囲が0..(n-1)のとき、(a,b)=(-1,n)で呼んで良い
bsearch f (a,b)
    | a+1 == b = a
    | f m  = bsearch f (m,b)
    | True = bsearch f (a,m)
    where m = (a + (b-a)`div`2)

f x a = ((a+1)`div`2 * 6 + a`div`2 * 5) < x

main=do
    x<-readLn::IO Int
    print $ (+) 1 $ bsearch (f x) (-1, 100000000000000)
