import math from functools import reduce n = int(input()) print(str(reduce(lambda x,y:x*y,list(range(1,n+1))))[-12:])