#calculate factorial by multiplying n by n-1,
#then by n-2, then by n-3, etc.
x=int(input("type in a number\n"))
i=1
for j in range(x):
  i=i*(x-j)
print 'factorial of ',x,' is ',i
