def main(): import sys input = sys.stdin.readline mod = 10**12 ans = 1 N = int(input()) for i in range(1, N+1): ans = (ans * i)%mod if ans == 0: print('000000000000') exit() print(ans) if __name__ == '__main__': main()