#!/usr/bin/python3

import sys
import itertools

s = next(sys.stdin).rstrip()
n = len(s)
a = 0
# b = [0 for i in range(n + 1)]
succ = [[] for i in range(n)]
d = {0: [0]}
for i, c in enumerate(s):
    ac = ord(c) - 0x61
    br = 1 << ac
    a = a ^ br
    # b[i + 1] = a
    # print("i = {}, a = {:08X}".format(i, a))
    if a not in d:
        d[a] = []
    d[a].append(i + 1)
    for alt in itertools.chain([1 << rot for rot in range(26)], [0]):
        x = a ^ alt
        if x in d:
            # print("x, d[x]", x, d[x])
            for j in d[x]:
                if j < i + 1:
                    succ[j].append(i + 1)

reached = [None for i in range(n + 1)]
reached[n] = 0

def path(i, max_):
    if reached[i] is not None:
        return reached[i] if max_ is None or reached[i] <= max_ else None
    ret = None
    for j in reversed(succ[i]):
        newmax = None if max_ is None else max_ - 1
        c = path(j, newmax)
        if c is not None:
            ret = c + 1
            max_ = ret - 1  # == c
    if ret is not None:
        reached[i] = ret
    return ret


def pathNR(i, max_):
    dict = { 'remain': succ[i], 'pos': i, 'max': max_, 'ret': None }
    stack = []

    def one_better(v, w):
        if v is None:   return False
        elif w is None: return True
        else:           return v + 1 < w

    def updateRet(v):
        if one_better(v, dict['ret']):
            dict['ret'] = v + 1
            dict['max'] = dict['ret'] - 1  # == v

    while True:
        if dict['remain']:
            j = dict['remain'].pop()
            if reached[j] is not None:
                updateRet(reached[j])
            else:
                stack.append(dict)
                dict = { 'remain': succ[j], 'pos': j,
                         'max': None if dict['max'] is None
                                     else dict['max'] - 1,
                         'ret': None }
        else:
            pRet = dict['ret']
            if stack:
                dict = stack.pop()
                updateRet(pRet)
            else:
                return pRet

# for i in range(len(succ)):
    # print(i, succ[i])

x = pathNR(0, None)
print(x)
