while n = gets s = 1 1.upto(n.to_i){|i| s = s*i } puts s end