#include <bits/stdc++.h>
using namespace std;
bool IsPalindrome(char a[])
{
int i = 0;
int j = strlen(a) - 1;
while (i < j)
{
if (a[i] != a[j])
return false;
i++;
j--;
}
return true;
}
int main()
{
char a[1000];
char x[1000];
cin >> a;
int n = strlen(a);
int cnt = 0;
int strCnt = 0;
for (int i = 0; i < n; i++)
{
for (int j = i; j < n; j++)
{
for (int k = i; k <= j; k++)
{
// cout << a[k] << " ";
x[cnt] = a[k];
if (IsPalindrome(x) == true)
{
strCnt++;
}
cnt++;
}
}
}
cout << strCnt;
return 0;
}