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
    let p2 = sum $ map (check 2) ns
    let p5 = sum $ map (check 5) ns
    print $ min p2 p5


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

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