import Data.List (sort, group)

f n = n*(n-1)`div`2 + 1

main :: IO ()
main = do
  s <- sort <$> getLine :: IO String
  let a = f (length s)
      ss = sum $ map (subtract 1.f.length) $ group s
  print $ a - ss
