# -*- 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 = factorial(N) % modulo ans = str(ans) zeros_str = '0'*(12-len(ans)) print(zeros_str+ans)