finish problem18, problem18.input is the data copy from html