from collections import defaultdict, deque, Counter
import sys
import heapq
import math

input = sys.stdin.readline

sys.setrecursionlimit(10000000)

MIN = -10 ** 9
MOD = 10 ** 9 + 7


def solve(pre, s):
    if len(s) == 1:
        if pre != s:
            return 1
        return None
    for i in range(1, len(s)):
        if pre == s[:i]:
            continue
        r = solve(s[:i], s[i:])
        if r is not None:
            return r + 1
    if pre != s:
        return 1


def main():
    s = input().strip()
    # N = int(input())
    print(solve("", s))
    # N, A, B = [int(a) for a in input().split()]
    # A = [
    #     [int(a) for a in input().split()]
    #     for _ in range(N)
    # ]


if __name__ == '__main__':
    main()
