a=int(input()) t=1 for var in range(a,1,-1): t*=var t=str(t) print(t[-12:])