stroka = input()
counter = 1
max = 0
for i in range(1, len(stroka)):
if stroka[i] == stroka[i-1] == 'к':
counter = counter + 1
if counter > max:
max = counter
else:
print(max)
stroka = input()
counter = 1
max = 0
for i in range(1, len(stroka)):
if stroka[i] == stroka[i-1] == 'к':
counter = counter + 1
if counter > max:
max = counter
else:
counter = 1
print(max)