S = gets.chomp.chars

counter = Hash.new(0)

S.each do |s|
  counter[s] += 1
end

odds_count = counter.count { |k, v| v.odd? }
counts = counter.values.map { |n| n.even? ? n : nil }.compact

while odds_count < counts.size && counts.size > 1
  counts.sort!

  a, b = counts.shift(2)
  counts.push(a + b)
end

if odds_count == 0
  puts S.size
else
  if counts.size == 0
    puts 1
  else
    puts counts.min + 1
  end
end
