#直接范围列表的最后一个元素。索引为[-1]
while True:
    try:
        str = input()
        arr = str.split(' ')
        print(len(arr[-1]))
    except:
        break