s=input()	

dict_alpha_number = {"a":0, "b":1, "c":2, "d":3, "e":4, "f":5, "g":6, "h":7, "i":8, "j":9, "k":10, "l":11, "m":12, "n":13, "o":14, "p":15, "q":16, "r":17, "s":18, "t":19, "u":20, "v":21, "w":22, "x":23, "y":24, "z":25}

li = [[] for i in range(26)]

cnt = 0
join_str = ""

for i in range(len(s)):
  tmp_str = join_str + s[i]
  if tmp_str in li[dict_alpha_number[tmp_str[0]]]:
    join_str += s[i]
    
  else :
    li[dict_alpha_number[tmp_str[0]]].append(tmp_str)
    join_str = ""
    cnt += 1
  
    
print(cnt)