S = list(input())
if len(S) == 1:
  print(1)
  exit()
join = [0] * (len(S) - 1)
maxv = 0
for i in range(2**(len(S) - 1)):
  s = str(bin(i)[2:])
  dic = {}
  tmp = S[0]
  flg = True
  
  for num, j in enumerate(s.zfill(len(S) - 1)):
    if j == '1':
      tmp += S[num + 1]
     # print(tmp+',', end='')
    else:
      if tmp in dic:
        flg = False
        break
      dic[tmp]=0
      tmp = S[num + 1]
  dic[tmp] = 0
  
  maxv = max(maxv, len(dic))  
  
print(maxv)