program main implicit none integer*8::N,i,M read *,N if(N.ge.60) then print '("000000000000")' return end if M=1 do i=1,N M = MOD(M*i,10**12_8) end do if(N.ge.15) then print '(i12.12)',M else print '(i0)',M end if end program main