from functools import reduce def main(): n = int(input()) if n > 50: # こんなことに気づかないなんて…… print("000000000000") return result = reduce(lambda x, y: x * y, range(1, n + 1)) % 1000000000000 if result > 1000000000000: print("{:012}".format(result)) else: print(result) if __name__ == "__main__": main()