import Data.Maybe
import Control.Monad
import qualified Data.ByteString.Char8 as C

readInt' = fst.fromJust.C.readInt
readLnInt = map readInt'.C.words<$>C.getLine
readCsInt n = concat<$>replicateM n readLnInt

x ? (a,b) = if x then a else b
a~>(f,x) = [a] ++ (null x)?([],f x)
half = flip div 2
aliq = ((0==).).mod

main = do
  [n] <- readLnInt
  print $ solve n

solve n = calc n 0

calc n t = (n==0)?(t,calc (n-1) t') where
  t' = ((aliq n 3)||(aliq n 5))?(n,0)
