main = do
  a <- getLine
  let d = zip ['a'..] (repeat 0)
  print $ solve d a
 
solve _ [] = 1
solve d (x:xs)  = solve d' xs + sum [ n | (c, n) <- d, c \= x ]
  where 
    d' = map (\(c, n) -> (c, if c == x then succ n else n)) d

