import math if __name__ == '__main__': n = int(input()) answer = math.factorial(n) % (10 ** 12) print(answer)