def jiecheng(n)
        sum=1
        if n<0 || n>20
          puts "invalid"
        else
         for i in 1..n
          sum=i*sum
          i=i+1
         end
        puts sum
        end
end
a=gets.chomp.to_i
jiecheng(a)