{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eA regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string \"ABCDEDCBA\" is a palindrome because it is the same when the string is read from left to right as when the string is read from right to left.\u003c/p\u003e\n\u003cp\u003eNow give you a string S, you should count how many palindromes in any consecutive substring of S.\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003e\nThere are several test cases in the input. Each case contains a non-empty string which has no more than 5000 characters.\u003c/p\u003e\n\u003cp\u003e\nProceed to the end of file.\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003e\nA single line with the number of palindrome substrings for each case.\n\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eSample Input\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003e\naba\u003cbr\u003e\naa\u003cbr\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eSample Output\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003e\n4\u003cbr\u003e\n3\u003cbr\u003e\u003c/p\u003e\n\n\u003cbr\u003e\n"}}]}