n,S=open(a:=0) while S: T,*S=S for c in S:a+=T==T[::-1];T+=c print(a)