s = raw_input()

def process(d, c):
  d[c] = d.get(c, 0) + 1
  d['odds'] += 1 if d[c] % 2 == 1 else -1

  d['child'] = filter(lambda v:process(v,c), d['child'])
  if d['odds'] <= 1:
    d['child'].append({ 'child': [], 'odds': 0 })

  return d['odds'] > 0

root = {
  'child': [],
  'odds': 0
}

for c in s:
  process(root, c)

ans = 1
nodes = [root]
while nodes:
  nex = []
  for n in nodes:
    if n['odds'] <= 1:
      print ans
      exit()
    nex += n['child']
  nodes = nex
  ans += 1
print "error"