a=1 for i in range(1,min(60,int(input())+1)):a*=i print(str(a)[-12:])