{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eAlice and Bob need to send secret messages to each other and are discussing ways to encode their messages:\u003cbr\u003e\u003cbr\u003eAlice: \"Let\u0027s just use a very simple code: We\u0027ll assign \u0027A\u0027 the code word 1, \u0027B\u0027 will be 2, and so on down to ‘Z’ being assigned 26.”\u003cbr\u003eBob: \"That\u0027s a stupid code, Alice. Suppose I send you the word \u0027BEAN\u0027 encoded as 25114. You could decode that in many different ways!”\u003cbr\u003eAlice: \"Sure you could, but what words would you get? Other than \u0027BEAN\u0027, you\u0027d get ‘BEAAD’, ‘YAAD’, ‘YAN’, ‘YKD’ and ‘BEKD’. I think you would be able to figure out the correct decoding. And why would you send me the word ‘BEAN’ anyway?”\u003cbr\u003eBob: \"OK, maybe that\u0027s a bad example, but I bet you that if you got a string of length 500 there would be tons of different decodings and with that many you would find at least two different ones that would make sense.”\u003cbr\u003eAlice: \"How many different decodings?\"\u003cbr\u003eBob: \"Jillions!\" \u003cbr\u003e\u003cbr\u003eFor some reason, Alice is still unconvinced by Bob’s argument, so she requires a program that will determine how many decodings there can be for a given string using her code.\u003cbr\u003e\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"Input will consist of multiple input sets. Each set will consist of a single line of digits representing a valid encryption (for example, no line will begin with a 0). There will be no spaces between the digits. An input line of ‘0’ will terminate the input and should not be processed\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each input set, output the number of possible decodings for the input string. All answers will be within the range of a long variable.\u003cbr\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e25114\r\n1111111111\r\n3333333333\r\n0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e6\r\n89\r\n1\r\nIt can be confirmed that no zero in the head and no trailing zeros in the integer. \r\nPlease pay special notice on the position of zero.\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"Hint"}}]}