def factorialTrailingZeros(n):
    """
    Function to count the number of trailing 0s in a factorial number.

    Parameters:
    n (int); the number for which the factorial and trailing 0s are to be calculated.

    Returns:
    trailingZeros (int); the number of 0s in the calculated factorial number.
    
    """
    try:

        if not(isinstance(n,int)) or (n<0): #If n is not a positive int
            raise TypeError
        
        ans = 1
        trailingZeros = 0
    
        # Calculating the factorial of 'n'
    
        while n >= 1: # Loop stops when n becomes 0
            ans *= n
            n -= 1

        # Calculating the number of 0s in 'ans'
    
        while float(ans % 10) == 0: # Loop stops when 'ans' is not divisible by 10, in other words it no longer has 0s in it.
            trailingZeros += 1
            ans = ans // 10
    	
    	
        return trailingZeros 

    except:
        print("Error: Invalid input. Please try again with a positive integer only.")
        return "Failed"