n = gets.chomp.to_i ans = 1 mod = 10**12 for i in 1..n ans = ans * i % mod if ans == 0 puts "000000000000" exit(0) end end puts ans