from string import ascii_lowercase

cd = {c: 1 << i for i, c in enumerate(ascii_lowercase)}
bt = set(cd.values())
bt.add(0)


def solve(s):
    q = {s}
    n = 0
    while True:
        nq = set()
        for s in q:
            if not s:
                return n
            b, li = 0, 0
            for i, c in enumerate(s):
                b ^= cd[c]
                if b in bt:
                    li = i
            nq.add(s[li + 1:])
            b, li = 0, 0
            for i, c in enumerate(s[::-1]):
                b ^= cd[c]
                if b in bt:
                    li = i
            nq.add(s[:len(s) - li - 1])

        q = nq
        n += 1


print(solve(input()))
