def main(): n = int(input()) if n >= 50: print('000000000000') return res = 1 for n in range(1, n+1): res *= n print(str(res%(10**12)).zfill(12)) if __name__ == "__main__": main()