local n, s = io.read("l","l")
local cnt = {}
for i = 1, n do
    local ch = string.sub(s, i, i)
    cnt[ch] = (cnt[ch] or 1) + 1
end
local ans = 1
for _, v in pairs(cnt) do
    ans = ans * v
end
print(ans - 1)
