Str = input()
assert(len(Str)<=5000,'字符串长度不得超过5000')
s = Str.split(' ')
last_str = s[-1]
assert(last_str != '','字符串末尾不以空格为结尾')
print(len(last_str))