gets
s=gets.chop

alpha = "abcdefghijklmnopqrstuvwxyz"

#p alpha.size
h=Hash.new
alpha.size.times { |i|
  h[alpha[i]]=0
}

res = 0
s.size.times {|i|
  c= s[i]
  sum = 1
  h.each { |k,v|
    if k != c
      sum *= v + 1
    end
  }
  h[c] += 1
  res += sum
}

p res