s=input() sset=set() def cal(x,ss): if x in sset: return if len(x) == len(s): sset.add(x) return cal(x+ss[0],ss[1:]) cal(x+ss[-1],ss[:-1]) cal(s[0],s[1:]) cal(s[-1],s[:-1]) print(sset) print(len(sset))