N = int(input()) a = 1 if N >= 50: print('0'*12) else: for i in range(2,N+1): a *= i print(str(a)[-12:])