from functools import reduce def main(): n = int(input()) print(reduce(lambda x, y: x * y, range(1, n + 1)) % 1000000000000) if __name__ == "__main__": main()