local s = io.read()
local n = #s
local t = {}
local sstr = ""
for i = 1, n do
  sstr = s:sub(i, i)
  if not t[sstr] then
    t[sstr] = 1
  else
    t[sstr] = t[sstr] + 1
  end
end
local ret = 0
for i = 1, n do
  sstr = s:sub(i, i)
  ret = ret + n - t[sstr]
end
print(1 + math.floor(ret / 2))
