#include
#include
#include
#include
using namespace std;
//回溯法
bool IsPalindRome(string str){
int end=str.length()-1;
int start=0;
while(start<end){
if(str[start]==str[end]){
start++;
end--;
}else{
return false;
}
}
return true;
}
void partitionCore(string s,vector<vector>& result,vector& path){
int len=s.size();
if(len<1){
result.push_back(path);
}
for(int i=0;i<len;i++){
string str=s.substr(0,i-0+1);
if(IsPalindRome(str)){
path.push_back(str);
partitionCore(s.substr(i+1),result,path);
path.pop_back();
}
}
}
vector<vector> partition(string s) {
vector<vector > result;
vector path;
partitionCore(s,result,path);
return result;
}
int main()
{
string s;
cin>>s;
vector<vector > re;
vectorfin;
re=partition(s);
for(int i=0;i<re.size();i++)
{
for(int j=0;j<re[i].size();j++)
{
//cout<<re[i][j]<<" ";
fin.push_back(re[i][j]);
}
}
//cout<<endl;
sort(fin.begin(),fin.end());
vector::iterator its=fin.end();
vector::iterator ite;
ite=unique(fin.begin(),fin.end());
fin.erase(ite,its);
cout<<fin.size();
return 0;
}