n=input() from math import * a=str(factorial(n)) if(len(a)>=12):print(a[-12:]) else:print a