from collections import defaultdict
d = defaultdict(bool,False)
s = str(input().rstrip())
l=0
r=1
while(r<len(s)):
	if(d[s[l:r]]==False):
      d[s[l:r]]=True
      l=r
      r+=1      
    else:
      r+=1

ans=0
for key,val in d.items():
  if(val==True):ans+=1

print(ans)