s=[]
s = gets.chars
x=[]
x = s.uniq
x.each_with_index do |a,i|
  sd = s.index(x[i])
  s.delete_at(sd)
end

s.permutation(2).to_a.map{|k|
  break if s.size <= 1
  x << k.inject(:+) unless x.include?(k.inject(:+))
  k.each do |kk|
    s.delete_at(s.find_index(kk)) unless s.find_index(kk).nil?
  end
  x << s if s.size == 1
}
#p s.combination(1).to_a.map{|k| x = k.inject(:+)}
puts x.size
