import Data.List
f::Integer->Integer->[Integer]
f _ 1=[]
f m n
   |n `mod` m==0 =m:f m (n `div` m)
   |otherwise=f (m+1) n

f2::[[[Integer]]]->[Int]
f2 []=[]
f2 (x:xs)=product (map (+1) (map length x)):(f2 xs)

main = do
       a<-getLine
       let b=read a::Integer
       print $ length $ filter (==8)$ f2 $ map group $ map (f 2) $ [1,3..b] 