s=eval(input())



max_len=0

tmp=""



for i in range(1,min(len(s)+1,3)):

  last=s[:i]

  cnt=1

  for s_ in s[i:]:

    tmp+=s_

    if tmp != last:

      last=tmp

      tmp=''

      cnt+=1

  max_len=max(max_len,cnt)



print(max_len)
s=eval(input())

 

tmp=""

last=""

cnt=0

for s_ in s:

  tmp+=s_

  if tmp != last:

    last=tmp

    tmp=''

    cnt+=1

print(cnt)
s = eval(input())
max_len = 0
tmp = ""
for i in range(1, min(len(s) + 1, 3)):
    last = s[:i]
    cnt = 1
    for s_ in s[i:]:
        tmp += s_
        if tmp != last:
            last = tmp
            tmp = ""
            cnt += 1
    max_len = max(max_len, cnt)
print(max_len)

s = eval(input())
tmp = ""
last = ""
cnt = 0
for s_ in s:
    tmp += s_
    if tmp != last:
        last = tmp
        tmp = ""
        cnt += 1
print(cnt)

-max_len = 0 -for i in range(1, min(len(s) + 1, 3)): -    last = s[:i] -    cnt = 1 -    for s_ in s[i:]: -        tmp += s_ -        if tmp != last: -            last = tmp -            tmp = "" -            cnt += 1 -    max_len = max(max_len, cnt) -print(max_len) +last = "" +cnt = 0 +for s_ in s: +    tmp += s_ +    if tmp != last: +        last = tmp +        tmp = "" +        cnt += 1 +print(cnt)