n=gets.to_i a=[1] 2.upto(65) do |i| a<< a[-1]*i end if n>65 puts "000000000000" else puts a[n-1].to_s[-12..-1] end