def func(s):
    if max(s) == min(s):
        return 1
    else:
        return func(s[1:]) + func(s[:-1])

s = raw_input()
print func(s)