# 2019 IUSB Programming Competition # Round 1 Problem 3 # Count the number of training 0s in n! # Solution by Dana Vrajitoru # Uses Python 3.6.2 # Find out how many times we can divide n by 5 exactly def count5Factors(n): count = 0 while n % 5 == 0: count = count + 1 n = n / 5 return count # Count the trailing 0s in n! # Find out how many times we can divide k by 5 exactly # for every k between 2 and n def trailingZeros(n): count = 0 for k in range(2, n+1): count += count5Factors(k) return count # Testing the function if __name__ == '__main__': print("Enter a number:") n = int(input()) print(trailingZeros(n))