# https://www.acmicpc.net/problem/1152
s = input()
print(s.strip().count(' ') + 1) if s.count(' ') != len(s) else print(0)


'''
# 숏코딩
print(len(input().split()))
'''

5caf7d02a69491ad93b338979792a938e49f827b
<mask token>

<mask token>
print(s.strip().count(' ') + 1) if s.count(' ') != len(s) else print(0)
<mask token>

s = input()
print(s.strip().count(' ') + 1) if s.count(' ') != len(s) else print(0)
<mask token>

# https://www.acmicpc.net/problem/1152
s = input()
print(s.strip().count(' ') + 1) if s.count(' ') != len(s) else print(0)


'''
# 숏코딩
print(len(input().split()))
'''
