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