import sys

s = input()
end = len(s)-1

last = [-1] * 2

dic = {}
alp = "abcdefghijklmnopqrstuvwxyz"
for i in alp:
    dic[i] = 0

ans = 0
alp = "abcdefghijklmnopqrstuvwxyz"

while True:

    dic = {}
    last = [-1] * 2
    for i in alp:
        dic[i] = 0

    t = "".join(reversed(list(s)))
    
    for i in range(len(s)):
    
        dic[s[i]] ^= 1

        ns = 0
        for j in dic:
            ns += dic[j]

        if ns < 2:
            last[ns] = i

    
    s = s[max(last)+1:]
    


    dic = {}
    last = [-1] * 2
    for i in alp:
        dic[i] = 0
    
    for i in range(len(t)):

        dic[t[i]] ^= 1

        ns = 0
        for j in dic:
            ns += dic[j]

        if ns < 2:
            last[ns] = i

    
    t = t[max(last)+1:]

    t = "".join(reversed(list(t)))
    #print (s,t)

    if len(s) > len(t):
        s = t

    if len(s) == 0:
        print (ans+1)
        sys.exit()
    else:
        ans += 1


