n: int = min(int(input()), 51) res = 1 while n := n - 1: res *= n + 1 print(str(res)[-12:])