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

readInt = fst . fromJust . BS.readInt
getInt = readInt <$> BS.getLine

main = do
    n <- getInt
    let ns = f n
    print $ min p2 p5
        where ns = f n
              p2 = foldl (check 2) 0 ns
              p5 = foldl (check 5) 0 ns

f n | n <= 1 = [1]
    | otherwise = n : f (n - 2)

check x s n | n `mod` x == 0 = s + 1 + check x 0 (n `div` x)
            | otherwise = s