MOD = 10**12 n = int(input()) count2 = 0 count5 = 0 product = 1 for i in range(1, n + 1): temp = i # Count factors of 2 cnt2 = 0 while temp % 2 == 0: cnt2 += 1 temp //= 2 count2 += cnt2 # Count factors of 5 cnt5 = 0 while temp % 5 == 0: cnt5 += 1 temp //= 5 count5 += cnt5 # Multiply the remaining part to the product product = (product * temp) % MOD # Calculate powers of 2 and 5 modulo MOD pow2 = pow(2, count2, MOD) pow5 = pow(5, count5, MOD) result = (product * pow2) % MOD result = (result * pow5) % MOD print(result)