words = input()
num = len(words)
for i in words:
    if i ==" " or i == "\n":
        num -= 1
print(num)

!=会出现偏差,在判断条件时最好不要用!=