S=raw_input() ans=0 for i in range(len(S)): for j in range(i,len(S)): if i==0 and j==len(S)-1: continue I,J=i,j ok=True while I