To find the number of substrings of a string that are palindromes