# -*- coding: utf-8 -*- N = int(input()) modulo = 10**12 def factorial(a): if a==0 or a==1: return 1 else: return ((a%modulo) * (factorial(a-1)%modulo)) ans = '' if N<=14: ans = factorial(N) % modulo elif N<=50: ans = factorial(N) % modulo ans = str(ans) zeros_str = '0'*(12-len(ans)) else: ans = '0' * 12 print(ans)