# AGC037A - Dividing a String
def main():
    S = input().rstrip()
    ans, cnt, cur = 0, 0, set()
    for i in S:
        cnt += 1
        cur |= {i}
        if cnt == 3:
            ans += max(2, len(cur))
            cnt, cur = 0, set()
    ans += len(cur)
    print(ans)


if __name__ == "__main__":
    main()