import Control.Monad
main = do
  n <- readLn
  unless (n == 0) $ do
    print.numOfContinuasZero $ n
    main

numOfContinuasZero n = fiveFactor
  where fiveFactor = sum $ map (factorPiece 5) [1..n]

factorPiece f n
  | n < f = 0
  | n `mod` f == 0 = 1 + factorPiece f (n `div` f)
  | otherwise = 0