dd = Array.new('z'.ord+2){0}
$stdin.readline.chomp.each_char.to_a.sort.map(&:ord).each{|k|
  dd[k] += 1
}
res = 0
150.times{
  c = 0
  r = 0
  while c < dd.size
    if dd[c]==0
      res += if r>=3 then 3 else r end
      r = 0
    else
      dd[c] -= 1
      r += 1
    end
    c+=1
  end
}

puts res