str = "aroeijgioej wji ojij sms. ssfs.ss ."
i = 0
a = 0
while i < len(str):
	if(str[i] == " " or str[i] == "."):
		a = a + 1
	i += 1
print (a)