#Python 3.8.3 x64
import functools
from functools import reduce
def main():
n = int(input())
rng = range(3, n+1)
print(reduce(lambda p, q: p * q, rng))
if __name__ == '__main__':
main()
#Python 3.8.3 x64
import functools
from functools import reduce
def main():
n = int(input())
rng = range(3, n+1)
print(reduce(lambda p, q: p * q, rng))
if __name__ == '__main__':
main()