s = input()
n = len(s)
count = 0

while True:
    if '111000' in s:
        count += s.count('111000') * 6
        s = s.replace('111000','')
    if '000111' in s:
        count += s.count('000111') * 6
        s = s.replace('000111','')
    if '1100' in s:
        count += s.count('1100') * 4
        s = s.replace('1100','')
    if '0011' in s:
        count += s.count('0011') * 4
        s = s.replace('0011','')
    if '10' in s:
        count += s.count('10') * 2
        s = s.replace('10','')
    elif '01' in s:
        count += s.count('01') * 2
        s = s.replace('01','')
    else:
        break

print(count)
