既然你说非空,那我就要不讲武德了,很快啊~

while True:
    try:
        print(len(input().split()[-1]))
    except:
        break