import sys

sys.stdin = open("strange.in", "r")
sys.stdout = open("strange.out", "w")

s = input()
n = len(s)

def good(s):
    cnt = 0
    for i in range(1, len(s)):
        if s[i] != s[i - 1]:
            cnt += 1
            if cnt > 1:
                return False
    return True

a = set()
for i in range(n):
    for j in range(i, n):
        if good(s[i:j + 1]):
            a.add(s[i : j + 1])

print(len(a))