f = 1 for i in xrange(1, min(input()+1, 100)): f = f * i print f % (10**12)